Summary: | In function p11_mmap_open, wrong comparison of mmap return value (Unix) | ||
---|---|---|---|
Product: | p11-glue | Reporter: | Gilles Mouchard <gilles.mouchard> |
Component: | p11-kit | Assignee: | Stef Walter <stefw> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | A patch against version p11-kit 0.20.2 (untested) |
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.
Created attachment 93961 [details] A patch against version p11-kit 0.20.2 (untested) Hello, I think that, in function p11_mmap_open, in file common/compat.c, at line #220, the comparison of mmap return value is wrong. The return value must be compared to MAP_FAILED (i.e. (void *) -1) instead of NULL. This can lead to bad munmap later in p11_mmap_close, for example while parsing an empty /etc/pkcs11/pkcs11.conf file with function _p11_conf_parse_file.