diff options
author | Stu Tomlinson <nosnilmot@pidgin.im> | 2007-11-22 16:32:56 +0000 |
---|---|---|
committer | Stu Tomlinson <nosnilmot@pidgin.im> | 2007-11-22 16:32:56 +0000 |
commit | b0213808635659c69b5379c2e427149b54af1a17 (patch) | |
tree | 7da1668b0acf1814118605cf874ba35184bb08e8 | |
parent | 3255f7d5e4fd56b5e65fc0e904a386ff04ccac04 (diff) | |
download | pidgin-b0213808635659c69b5379c2e427149b54af1a17.tar.gz |
Fix a bug in purple_str_to_time() that could cause it to try reading past
the end of the input string
-rw-r--r-- | libpurple/util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libpurple/util.c b/libpurple/util.c index 82b9fb34fb..946e73e47b 100644 --- a/libpurple/util.c +++ b/libpurple/util.c @@ -817,8 +817,11 @@ purple_str_to_time(const char *timestamp, gboolean utc, t->tm_isdst = -1; - if (*c == '.' && *(c+1) >= '0' && *(c+1) <= '9') /* dealing with precision we don't care about */ - c += 4; + if (*c == '.') { + do { + c++; + } while (*c >= '0' && *c <= '9'); /* dealing with precision we don't care about */ + } if (*c == '+') offset_positive = TRUE; if (((*c == '+' || *c == '-') && (c = c + 1)) && |