From kostik@ncport.ru  Mon Nov 29 18:12:39 2004
Return-Path: <kostik@ncport.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AE71E16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Nov 2004 18:12:39 +0000 (GMT)
Received: from mail.ncport.ru (mail.ncport.ru [213.134.192.6])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 234DB43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 29 Nov 2004 18:12:39 +0000 (GMT)
	(envelope-from kostik@ncport.ru)
Received: from localhost (localhost [127.0.0.1])
	by mail.ncport.ru (mail.ncport.ru) with ESMTP id 9DEE136740A;
	Mon, 29 Nov 2004 21:12:35 +0300 (MSK)
Received: from fuzzy.ncport.ru (fuzzy.ncport.ru [213.134.203.22])
	by mail.ncport.ru (mail.ncport.ru) with ESMTP id 1E7C1367434;
	Mon, 29 Nov 2004 21:12:34 +0300 (MSK)
Message-Id: <1101751955.0@fuzzy.ncport.ru>
Date: Mon, 29 Nov 2004 21:12:35 +0300
From: "kostik <kostik@ncport.ru>" <kostik@ncport.ru>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Cc: kostik@ncport.ru
Subject: gnomeicu crashes on incorrect history file.
X-Send-Pr-Version: gtk-send-pr 0.4.1 
X-GNATS-Notify:

>Number:         74522
>Category:       ports
>Synopsis:       net/gnomeicu2 crashes on incorrect history file.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-gnome
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 29 18:20:33 GMT 2004
>Closed-Date:    Sat Dec 18 22:35:05 GMT 2004
>Last-Modified:  Sat Dec 18 22:35:05 GMT 2004
>Originator:     kostik <kostik@ncport.ru>
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
Newcom Port ISP 
>Environment:


System: FreeBSD 5.2-CURRENT #0: Tue Aug 10 17:37:41 MSD 2004
    kostik@fuzzy.ncport.ru:/usr/obj/usr/src/sys/FUZZY



>Description:


When you try to open incorrectly formatted history file (left from much-much older version of gnomeicu, for example) the result was a core dump in src/history.c:history_parse_chunk():sscanf().


>How-To-Repeat:


Run gnomeicu ver. 0.99.5 and try open history with an incorrectly formatted user history file.


>Fix:



Apply the following patch, recompile and run:

=======================================
--- 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);
 =======================================



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-gnome 
Responsible-Changed-By: vs 
Responsible-Changed-When: Tue Nov 30 13:58:05 GMT 2004 
Responsible-Changed-Why:  
Over to GNOME-team 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74522 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Sat Dec 18 22:34:54 GMT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74522 
>Unformatted:
