bugfindutils - Bugs: bug #24169, segfault: -neweraa without a...

 
 

bug #24169: segfault: -neweraa without a following argument

Submitter:  James Youngman <jay>
Submitted:  Sat 30 Aug 2008 11:21:14 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Joey Hess Open/Closed:  Closed
Release:  4.3.5 Fixed Release:  4.5.2
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 31 Aug 2008 12:02:36 PM UTC, comment #2: 

Fixed in the 4.4.x tree.
Fixed in the 4.5.x tree.

Affected versions:
Versions of findutils before 4.3.3 do not support -newerXY and so are not affected.
Versions 4.3.3, 4.3.4: exit with status 1 after issuing an unintelligible message.  
Versions 4.3.5 - 4.3.10 are affected.
4.4.0 is affected.
4.5.0 is affected.
4.5.1 is affected.


James Youngman <jay>
Group administrator
Sun 31 Aug 2008 12:53:48 AM UTC, comment #1: 

I believe the attached patch fixes the problem.

(file #16402)

James Youngman <jay>
Group administrator
Sat 30 Aug 2008 11:21:14 PM UTC, original submission:  

~$ find --version
find (GNU findutils) 4.4.0
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS() CBO(level=0)
~$ find -neweraa
Segmentation fault (core dumped)
~$

~/source/GNU/findutils/cvs/4.4/compile/64$ gdb ./find/find core
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Core was generated by `./find/find -neweraa'.
Program terminated with signal 11, Segmentation fault.
[New process 6565]
#0  0x0000000000418e51 in quotearg_buffer_restyled (buffer=0x6384e0 "`",
    buffersize=256, arg=0x0, argsize=18446744073709551615,
    quoting_style=locale_quoting_style, flags=1,
    quote_these_too=0x7fff51dad388)
    at /home/james/source/GNU/findutils/cvs/4.4/findutils/gnulib/lib/quotearg.c:296
296   for (i = 0;  ! (argsize == SIZE_MAX ? arg[i] == '\0' : i == argsize);  i++)
(gdb) print i
$1 = 0
(gdb) print argv
No symbol "argv" in current context.
(gdb) print arg
$2 = 0x0
(gdb) up
#1  0x0000000000419761 in quotearg_n_options (n=1, arg=0x0,
    argsize=18446744073709551615, options=0x7fff51dad380)
    at /home/james/source/GNU/findutils/cvs/4.4/findutils/gnulib/lib/quotearg.c:723
723      options->quote_these_too);
(gdb)
#2  0x00000000004199ca in quotearg_n_style (n=4368168,
    s=<value optimized out>,
    arg=0xfefefefefefefeff <Address 0xfefefefefefefeff out of bounds>)
    at /home/james/source/GNU/findutils/cvs/4.4/findutils/gnulib/lib/quotearg.c:768
768   return quotearg_n_options (n, arg, SIZE_MAX, &o);
(gdb) print arg
$3 = 0xfefefefefefefeff <Address 0xfefefefefefefeff out of bounds>
(gdb) print o
$4 = {style = locale_quoting_style, flags = 0, quote_these_too = {0, 0, 0, 0,
    0, 0, 0, 0}}
(gdb) up
#3  0x0000000000408e12 in fatal_file_error (name=0x0)
    at /home/james/source/GNU/findutils/cvs/4.4/findutils/find/util.c:1006
1006   return quotearg_n_style (n, options.err_quoting_style, arg);
(gdb) print arg
No symbol "arg" in current context.
(gdb) up
#4  0x000000000040e0f6 in parse_newerXY (entry=0x42dc60, argv=0x7fff51dad638,
    arg_ptr=0x7fff51dad4f4)
    at /home/james/source/GNU/findutils/cvs/4.4/findutils/find/parser.c:1565
1565 fatal_file_error(argv[*arg_ptr]);
(gdb) print argv
$5 = (char **) 0x7fff51dad638
(gdb) print *arg_ptr
$6 = 2
(gdb)
$7 = 2
(gdb) print argv[0]
$8 = 0x7fff51dadb0c "./find/find"
(gdb) print argv[1]
$9 = 0x7fff51dadb18 "-neweraa"
(gdb) print argv[2]
$10 = 0x0
(gdb) quit

James Youngman <jay>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #16402:  sv-bug-2416.patch added by jay (4KiB - text/x-patch - Proposed bugfix #1)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jay (Submitted the item)
  • -email is unavailable- added by jay
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-09-07 jay Fixed ReleaseNone 4.5.2
    2008-09-07 jay Open/ClosedOpen Closed
    2008-08-31 jay StatusIn Progress Fixed
        Release4.4.0 4.3.5
    2008-08-31 jay Attached File- Added sv-bug-2416.patch, #16402
    2008-08-30 jay Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code