Bug 7019
| Summary: | getopt() causes segmentation error with first arg of zero | ||
|---|---|---|---|
| Product: | [Retired] Red Hat Linux | Reporter: | Andrew Wiseman <a.wiseman> |
| Component: | glibc | Assignee: | Jakub Jelinek <jakub> |
| Status: | CLOSED RAWHIDE | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | medium | ||
| Version: | 5.2 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i386 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2000-05-22 14:53:18 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
assign to jakub Fixed in glibc 2.1.92 |
Compile the following program with gcc and the resulting a.out causes a segmentation error. main(argc,argv) 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 core.