diff options
author | Havoc Pennington <hp@redhat.com> | 2007-07-12 22:18:05 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2007-07-12 22:18:05 +0000 |
commit | ed57b9c663db89370055c5196e7e0b537647e9ef (patch) | |
tree | 96c4f532c4827b8e3968c9e20acfa804b125af10 /dbus/dbus-sysdeps.c | |
parent | e339814224d54c9b048ead2d6965f89790ec318a (diff) | |
download | dbus-ed57b9c663db89370055c5196e7e0b537647e9ef.tar.gz |
2007-07-12 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps-util.c (_dbus_sysdeps_test): invert the test
for parsing hex as double to be sure it fails to work
* dbus/dbus-sysdeps.c (_dbus_string_parse_double): don't allow hex numbers.
Diffstat (limited to 'dbus/dbus-sysdeps.c')
-rw-r--r-- | dbus/dbus-sysdeps.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index c310b281..cd3e20e7 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -750,6 +750,12 @@ _dbus_string_parse_double (const DBusString *str, p = _dbus_string_get_const_data_len (str, start, _dbus_string_get_length (str) - start); + /* parsing hex works on linux but isn't portable, so intercept it + * here to get uniform behavior. + */ + if (p[0] == '0' && (p[1] == 'x' || p[1] == 'X')) + return FALSE; + end = NULL; errno = 0; v = ascii_strtod (p, &end); |