bug-sh-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

core dump in date (GNU sh-utils) 2.0


From: tony
Subject: core dump in date (GNU sh-utils) 2.0
Date: Sat, 18 Nov 2000 01:15:24 -0500

Hi:

I found a problem in  date (GNU sh-utils) 2.0

It shows up when using the file command. e.g.

                date --file=sample.data

On some platforms, there is a core dump while freeing an uninitialized pointer.

Included is the patch and some sample data that core dumps it on some plaforms.

-Tony Aiuto
address@hidden


--------------  the patch --------------------
*** orig/src/date.c     Sun Aug  1 06:59:22 1999
--- src/date.c  Sat Nov 18 01:06:51 2000
***************
*** 212,223 ****
    int line_length;
    size_t buflen;
    time_t when;
!   char *initial_TZ;
! 
! #ifdef lint
!   /* Suppress `may be used before initialized' warning.  */
!   initial_TZ = NULL;
! #endif
  
    if (strcmp (input_filename, "-") == 0)
      {
--- 212,218 ----
    int line_length;
    size_t buflen;
    time_t when;
!   char *initial_TZ = NULL;
  
    if (strcmp (input_filename, "-") == 0)
      {

--------------  date.sample  --------------------
20000201
20000202
20000203
20000204
20000205
20000206
20000207
20000208
20000209
20000210
20000211
20000212
20000213
20000214
20000215
20000216
20000217
20000218
20000219
20000220
20000221
20000222
20000223
20000224
20000225
20000226
20000227
20000228
20000229
-------- end date.sample ------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]