changeset 21611:87387eac4348

Fix a bug in purple_str_to_time() that could cause it to try reading past the end of the input string
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 22 Nov 2007 16:32:56 +0000
parents 0e4549c09e64
children 18fb032a602a
files libpurple/util.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/util.c	Thu Nov 22 02:56:20 2007 +0000
+++ b/libpurple/util.c	Thu Nov 22 16:32:56 2007 +0000
@@ -817,8 +817,11 @@
 
 			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)) &&