Bug 242276 - lang/pcc: pcc(1) cannot handle missing argument of option
Summary: lang/pcc: pcc(1) cannot handle missing argument of option
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joel Dahl
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2019-11-28 06:14 UTC by WHR
Modified: 2019-11-28 06:22 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (joel)


Attachments
lang/pcc/files/patch-cc_cc_cc.c (650 bytes, text/plain)
2019-11-28 06:14 UTC, WHR
no flags Details
lang.pcc.files.patch-cc_cc_cc.c.diff (svn diff) (639 bytes, patch)
2019-11-28 06:21 UTC, WHR
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description WHR 2019-11-28 06:14:05 UTC
Created attachment 209500 [details]
lang/pcc/files/patch-cc_cc_cc.c

For example:

$ pcc -I
Segmentation fault (core dumped)
$ gdb --args pcc -I
GNU gdb (GDB) 8.2 [GDB v8.2 for FreeBSD]
...
(gdb) r
Starting program: /usr/local/bin/pcc -I

Program received signal SIGSEGV, Segmentation fault.
0x28205c1d in strlen () from /lib/libc.so.7
(gdb) bt
#0  0x28205c1d in strlen () from /lib/libc.so.7
#1  0x28127bd0 in strdup () from /lib/libc.so.7
#2  0x0804c3ff in ?? ()
#3  0x0804c0e4 in ?? ()
#4  0x08049b03 in ?? ()
#5  0x08048d6b in ?? ()
#6  0x08048c38 in ?? ()
#7  0x00000000 in ?? ()


The attached patch fix the incorrect comparison of counter 'lac', in function 'nxtopt'; it also changes the loop control statement to prevent accidently lowering 'lac' to an negative value.
The patch was merged with the previous patch for same source file 'cc/cc/cc.c'.
Comment 1 WHR 2019-11-28 06:21:20 UTC
Created attachment 209501 [details]
lang.pcc.files.patch-cc_cc_cc.c.diff (svn diff)

Use a SVN diff file instead.