Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Oct 2002 20:47:39 +0800 (CST)
From:      Michael Hsin <mhsin@mhsin.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/44049: comms/gsmlib crashes when formatting timestamp of delivery messages
Message-ID:  <200210141247.g9ECldwj008220@Ada.mhsin.org>

next in thread | raw e-mail | index | archive | help

>Number:         44049
>Category:       ports
>Synopsis:       comms/gsmlib crashes when formatting timestamp of delivery messages
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 14 05:50:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Michael Hsin
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
NTU CSIE
>Environment:
System: FreeBSD a.mhsin.org 4.6-STABLE FreeBSD 4.6-STABLE #2: Sun Sep 1 19:42:18 CST 2002 root@a.mhsin.org:/usr/obj/usr/src/sys/fake i386


>Description:
The port comms/gsmlib uses strftime(3) to format timestamp when displaying
delivery message. But it put a NULL pointer as buf to strftime(3). This
causes a segmentation fault.
>How-To-Repeat:
Use the utility came with gsmlib called "gsmsmsstore", like:
  gsmsmsstore -l -b 19200 -s /dev/cuaa1 -t "SM"
to display delivery messages from a GSM mobile phone. It will crash when
formatting timestamp.
>Fix:
Define the BROKEN_STRFTIME symbol to avoid use of NULL point as buf to
strftime(3).

----------------------------------------------------------------------------

--- gsmlib/gsm_sms_codec.cc.orig	Thu Jan 10 07:52:53 2002
+++ gsmlib/gsm_sms_codec.cc	Mon Oct 14 15:31:28 2002
@@ -111,6 +111,9 @@
   t.tm_yday = 0;
   t.tm_wday = 0;
   
+/* MH: We DO have a "broken" strftime */
+#define BROKEN_STRFTIME
+/*    */
 #ifdef BROKEN_STRFTIME
   char formattedTime[1024];
   strftime(formattedTime, 1024, "%x %X", &t);


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210141247.g9ECldwj008220>