Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204519 - app-admin/cronolog: segfaults if an unknown long option is used
Summary: app-admin/cronolog: segfaults if an unknown long option is used
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Lance Albertson (RETIRED)
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-06 08:21 UTC by Carlo Marcelo Arenas Belon
Modified: 2008-05-06 20:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
getopt_long requires that the last record in the longopts array is filled with 0 as documented in getopt(3) (cronolog-getopt-long.patch,1.08 KB, patch)
2008-01-06 08:24 UTC, Carlo Marcelo Arenas Belon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlo Marcelo Arenas Belon 2008-01-06 08:21:08 UTC
cronolog leaves the array of long options as used in cronolog.c and cronotest.c without the required 0 filled last record, therefore the use of an unknown long option will traverse the array and segfault as shown in the linked URL

amd64 (at least for me) seems easier to replicate the problem as can be seen by :

$ /usr/sbin/cronolog --unknown-longopt
Segmentation fault
Comment 1 Carlo Marcelo Arenas Belon 2008-01-06 08:23:30 UTC
the same problem is also present in the test framework cronotest.c which doesn't get installed
Comment 2 Carlo Marcelo Arenas Belon 2008-01-06 08:24:57 UTC
Created attachment 140259 [details, diff]
getopt_long requires that the last record in the longopts array is filled with 0 as documented in getopt(3)
Comment 3 Lance Albertson (RETIRED) gentoo-dev 2008-05-06 20:03:29 UTC
Committed with patch, thanks!