[libgdata] core: Ignore overflows, but not alphamerics when parsing int64 from XML



commit 977e18d79e6cd238fcb2ac782967aef4f3890ef7
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Sep 4 11:13:14 2015 +0200

    core: Ignore overflows, but not alphamerics when parsing int64 from XML
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684920

 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 d9d1ede..1096921 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;


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