Bug 74904 - In function p11_mmap_open, wrong comparison of mmap return value (Unix)
Summary: In function p11_mmap_open, wrong comparison of mmap return value (Unix)
Status: RESOLVED DUPLICATE of bug 74773
Alias: None
Product: p11-glue
Classification: Unclassified
Component: p11-kit (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Stef Walter
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-12 20:42 UTC by Gilles Mouchard
Modified: 2014-02-12 21:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
A patch against version p11-kit 0.20.2 (untested) (457 bytes, text/plain)
2014-02-12 20:42 UTC, Gilles Mouchard
Details

Description Gilles Mouchard 2014-02-12 20:42:40 UTC
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.
Comment 1 Gilles Mouchard 2014-02-12 21:17:08 UTC

*** This bug has been marked as a duplicate of bug 74773 ***


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.