Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 7019 - getopt() causes segmentation error with first arg of zero
Summary: getopt() causes segmentation error with first arg of zero
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 5.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-11-15 16:50 UTC by Andrew Wiseman
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2000-05-22 14:53:18 UTC

Attachments (Terms of Use)

Description Andrew Wiseman 1999-11-15 16:50:36 UTC
Compile the following program with gcc and the resulting a.out causes a
segmentation error.

int argc;
char * argv[];
      int ii = getopt(0,"","hm:n:c:aq");

The cause is the first argumenet to getopt being zero. Normally argc and
argv are passed in, and so you probably wouldn't get an argc of zero.
However, one of our company's programmers decided to use zero to mean he
wasn't interested in the options passed. It certainly shouldn't dump the

Comment 1 Cristian Gafton 2000-05-22 14:53:59 UTC
assign to jakub

Comment 2 Jakub Jelinek 2000-08-09 13:32:31 UTC
Fixed in glibc 2.1.92

Note You need to log in before you can comment on or make changes to this bug.