Bug 7019 - getopt() causes segmentation error with first arg of zero
getopt() causes segmentation error with first arg of zero
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 1999-11-15 11:50 EST by Andrew Wiseman
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-05-22 10:53:18 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andrew Wiseman 1999-11-15 11:50:36 EST
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 10:53:59 EDT
assign to jakub
Comment 2 Jakub Jelinek 2000-08-09 09:32:31 EDT
Fixed in glibc 2.1.92

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