diff options
author | Debarshi Ray <debarshir@gnome.org> | 2015-09-04 11:13:14 +0200 |
---|---|---|
committer | Debarshi Ray <debarshir@gnome.org> | 2015-09-04 15:14:55 +0200 |
commit | 977e18d79e6cd238fcb2ac782967aef4f3890ef7 (patch) | |
tree | d32099dda6a5f1d1088bf827886b315c7fea1448 | |
parent | 840eea2f26fb8de25d8bc0b9a1e4ca57f50fd660 (diff) | |
download | libgdata-977e18d79e6cd238fcb2ac782967aef4f3890ef7.tar.gz |
core: Ignore overflows, but not alphamerics when parsing int64 from XML
https://bugzilla.gnome.org/show_bug.cgi?id=684920
-rw-r--r-- | gdata/gdata-parser.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gdata/gdata-parser.c b/gdata/gdata-parser.c index d9d1ede3..10969214 100644 --- a/gdata/gdata-parser.c +++ b/gdata/gdata-parser.c @@ -18,7 +18,6 @@ */ #include <config.h> -#include <errno.h> #include <glib.h> #include <glib/gi18n-lib.h> #include <sys/time.h> @@ -574,10 +573,8 @@ gdata_parser_int64_from_element (xmlNode *element, const gchar *element_name, GD } /* Attempt to parse the string as a 64-bit integer */ - errno = 0; val = g_ascii_strtoll ((const gchar*) text, &end_ptr, 10); - - if (errno != 0 || end_ptr == (gchar*) text) { + if (*end_ptr != '\0') { *success = gdata_parser_error_unknown_content (element, (gchar*) text, error); xmlFree (text); return TRUE; |