freebsd-ports/net-im/gnomeicu2/files/patch-src_history.c
Joe Marcus Clarke 33b28e4a9b Fix a crash that can occur with an improperly formatted history file.
PR:		74522
Submitted by:	kostik <kostik@ncport.ru>
2004-12-18 22:34:52 +00:00

14 lines
336 B
C

--- src/history.c.orig Mon Nov 29 20:48:25 2004
+++ src/history.c Mon Nov 29 20:21:37 2004
@@ -214,6 +214,11 @@
char direction;
time_t time;
+ if (! (ptr+4)) {
+ g_free (hp->buffer);
+ g_free (hp);
+ return FALSE;
+ }
/* read header info */
sscanf (ptr+4, "%c %d", &direction, (int *)&time);