bugfindutils - Bugs: bug #52220, 'find -D' segfaults

 
 

bug #52220: 'find -D' segfaults

Submitted by:  None
Submitted on:  Thu 12 Oct 2017 08:30:12 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: Bernhard Voelker <berny>
Originator Name: FelixOriginator Email: -unavailable-
Open/Closed: OpenRelease: 4.6.0
Fixed Release: 4.6.0

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 22 Oct 2017 06:53:57 PM UTC, comment #5:

Thanks for the review - pushed (with the duplicate "the" in the
commit message removed) at:
https://git.sv.gnu.org/cgit/findutils.git/commit/?id=ef1581ea51

Bernhard Voelker <berny>
Project MemberIn charge of this item.
Sat 21 Oct 2017 05:09:23 PM UTC, comment #4:

Works for me, thanks!

Tavian Barnes <tavianator>
Wed 18 Oct 2017 10:16:19 PM UTC, comment #3:

Thanks, this seems to be a problem with certain strtok_r
implementations. Mine here seems to handle NULL in the
first call.

Patch attached - please check.

(file #42192)

Bernhard Voelker <berny>
Project MemberIn charge of this item.
Sun 15 Oct 2017 09:31:49 PM UTC, comment #2:

Reproduces here:

The code does

but argv[i+1] is NULL. The first thing process_debug_options() does is

NULL arg is invalid as the first call to strtok_r.

Tavian Barnes <tavianator>
Thu 12 Oct 2017 11:26:09 PM UTC, comment #1:

I can't reproduce here:

$ find/find -D
find/find: Empty argument to the -D option.

$ find/find --version
find (GNU findutils) 4.6.0
...

and with the latest source from Git:

$ find/find -D
find/find: Empty argument to the -D option.
Try 'find/find --help' for more information.

Would you please provide more information, like information about
your environment, a stack trace, maybe strace output, etc.?

Thanks & have a nice day,
Berny

Bernhard Voelker <berny>
Project MemberIn charge of this item.
Thu 12 Oct 2017 08:30:12 PM UTC, original submission:

Hello,

1. the version of findutils you are using
version 4.6.0

3. the exact command line that you used
find -D

4. what you expected to happen
I expected to get "find: '-D' must take an argument" or the help version of -D.

5. precisely what did happen.
segfault

Thank you for your time.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #42192:  0001-find-avoid-segfault-with-D-without-argument.patch added by berny (4KiB - text/x-patch - [PATCH] find: avoid segfault with -D without argument)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by tavianator (Posted a comment)
  • -unavailable- added by berny (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 22 Oct 2017 06:53:57 PM UTCbernyStatusReady For Test=>Fixed
    Wed 18 Oct 2017 10:16:19 PM UTCbernyAttached File-=>Added 0001-find-avoid-segfault-with-D-without-argument.patch, #42192
      StatusNeed Info=>Ready For Test
    Thu 12 Oct 2017 11:26:09 PM UTCbernyStatusNone=>Need Info
      Assigned toNone=>berny

    Back to the top


    Powered by Savane 3.1-cleanup1