Opened 11 years ago
Closed 11 years ago
#9931 closed enhancement (fixed)
Allocate returned buffer in realpath() in case resolved_name's argument is NULL
Reported by: | oco | Owned by: | korli |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/libroot.so | Version: | R1/alpha4.1 |
Keywords: | realpath | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
Add support for NULL as resolved_name argument in realpath as defined in The Open Group Base Specifications Issue 7 IEEE Std 1003.1, 2013 Edition (http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html).
In this case, the returned buffer is allocated by realpath and can be passed to free().
The behavior was only "implementation defined" in previous revision like The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition (http://pubs.opengroup.org/onlinepubs/000095399/functions/realpath.html).
Yodl (http://yodl.sourceforge.net/) rely on this behavior in yodl/src/lexer/lchdir.c.
Attachments (1)
Change History (4)
by , 11 years ago
Attachment: | 0001-Add-support-for-NULL-as-resolved_name-argument-in-re.patch added |
---|
comment:1 by , 11 years ago
patch: | 0 → 1 |
---|
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Edited and applied in hrev46345. In case of error, the newly allocated buffer shall be freed.