[evolution-data-server] Bug 763951 - libedata-book: Handle an error return from e_sexp_parse()



commit 4223db602d3130490e80039bca8efd46f07072d3
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Mar 21 12:00:25 2016 +0100

    Bug 763951 - libedata-book: Handle an error return from e_sexp_parse()
    
    It’s possible for this function to fail to parse the provided query
    string, in which case we should return gracefully instead of proceeding
    to try and evaluate the sexp.
    
    Coverity CID: 1353081

 .../libedata-book/e-book-backend-sqlitedb.c        |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c 
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 923d166..d39ca3a 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -4010,7 +4010,9 @@ sexp_to_sql_query (EBookBackendSqliteDB *ebsdb,
        }
 
        e_sexp_input_text (sexp, query, strlen (query));
-       e_sexp_parse (sexp);
+
+       if (e_sexp_parse (sexp) == -1)
+               return NULL;
 
        r = e_sexp_eval (sexp);
        if (!r)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]