#11827 closed defect (fixed)
Tcl_AppendResult not NULL-terminated in fs-traverse.c
Reported by: | sfiera@… | Owned by: | kballard (Lily Ballard) |
---|---|---|---|
Priority: | High | Milestone: | MacPorts 1.4 |
Component: | base | Version: | 1.4 |
Keywords: | fs-traverse Tcl_AppendResult | Cc: | kballard (Lily Ballard), sfiera@… |
Port: |
Description
I was just trying to traverse a list of directories using fs-traverse. I have since realized that fs-traverse will not handle a list of directories. However, rather than failing gracefully and reporting that the requested directory didn't exist, it was crashing with a bus error. I traced this problem back to the invocations of Tcl_AppendResult in fs-traverse.c, which are used to report errors.
According to its manpage, Tcl_AppendResult takes a NULL-terminated list of strings. The invocations in fs-traverse.c didn't do this. I've patched it; however, although fs-traverse doesn't have a "maintainer," I'll defer to Eridius on committing it since it's his creation.
Attachments (1)
Change History (6)
Changed 17 years ago by sfiera@…
Attachment: | fs-traverse.diff added |
---|
comment:1 Changed 17 years ago by kballard (Lily Ballard)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Looks good. I've committed your patch in r24396. Sorry about that - I didn't have a problem in my own testing, I guess I was just lucky. And stupid for not even thinking about this issue, since I'm well acquainted with how varargs stuff works :/
As for a list of directories, you can use eval to work around that. Or I can "fix" fs-traverse to take a list of directories instead of the dynamic args it currently takes. I just created a new ticket, #11836, about this issue.
comment:2 Changed 17 years ago by kballard (Lily Ballard)
Milestone: | MacPorts 1.4.3 → MacPorts 1.5 |
---|
comment:3 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)
Milestone: | MacPorts 1.5 → MacPorts 1.4 |
---|
comment:4 Changed 17 years ago by nox@…
Cc: | eridius@macports.org,sfiera@macports.org → eridius@macports.org, sfiera@macports.org |
---|---|
Priority: | Important → High |
comment:5 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)
Never merged into the release_1_4 branch as such, but as the switch to the fts(3) family of functions for fs-traverse.c in r24908.
-jmpp
fs-traverse.c.diff