Summary: | segfault when parsing the anchors | ||
---|---|---|---|
Product: | p11-glue | Reporter: | Antoine Jacoutot <ajacoutot> |
Component: | p11-kit | Assignee: | Stef Walter <stefw> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | medium | CC: | stefw |
Version: | unspecified | ||
Hardware: | All | ||
OS: | OpenBSD | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
add missing include for libgen.h
trust: Don't use POSIX or GNU basename() |
Description
Antoine Jacoutot
2013-03-18 16:44:45 UTC
Could you attach the cert.pem for which this is occuring? (In reply to comment #1) > Could you attach the cert.pem for which this is occuring? Sure. But I guess the easier is to get it directly from: http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/lib/libssl/cert.pem?rev=1.22;content-type=text%2Fplain That's so strange. I can't duplicate this. Could you help me with a bit of debugging? In the stack trace below could you go up to build_object() (ie: #1) and print out the value of parser->basename You can also reach me at #p11-kit on freenode so we can do a bit of back and forth on this. It's also worth noting that in 0.17.x much of this code has been rewritten. But I'd still like to figure out why this code is crashing on OpenBSD so we can prevent a similar thing from happening. (In reply to comment #3) > That's so strange. I can't duplicate this. Could you help me with a bit of > debugging? In the stack trace below could you go up to build_object() (ie: > #1) and print out the value of parser->basename Sure thing. (gdb) print parser->basename $1 = 0xffffffffb33f23c0 <Address 0xffffffffb33f23c0 out of bounds> > You can also reach me at #p11-kit on freenode so we can do a bit of back and > forth on this. Nice. I'll join in a few; just ping me when you have some time, I'll be idling :-) Ok I found the issue. trust/parser.c is missing an include for libgen.h which basename(3) requires. (implicit declaration of function 'basename') The included patch fixes crash for me. Created attachment 76753 [details] [review] add missing include for libgen.h Created attachment 76755 [details] [review] trust: Don't use POSIX or GNU basename() Comment on attachment 76753 [details] [review] add missing include for libgen.h Review of attachment 76753 [details] [review]: ----------------------------------------------------------------- Besides this nastiness with the headers changing how basename() works, it's also not thread safe. So let's do our own. I've attached such a patch. > Besides this nastiness with the headers changing how basename() works, it's
> also not thread safe. So let's do our own. I've attached such a patch.
Works beautifully, thank you.
Attachment 76755 [details] pushed as 7c27e9f - trust: Don't use POSIX or GNU basename()
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.