Opened 7 years ago

Closed 7 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/ Version: R1/alpha4.1
Keywords: realpath Cc:
Blocked By: Blocking:
Platform: All


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 (

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 (

Yodl ( rely on this behavior in yodl/src/lexer/lchdir.c.

Attachments (1)

0001-Add-support-for-NULL-as-resolved_name-argument-in-re.patch (1.8 KB ) - added by oco 7 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by oco, 7 years ago

patch: 01

comment:2 by korli, 7 years ago

Owner: changed from axeld to korli
Status: newassigned

comment:3 by korli, 7 years ago

Resolution: fixed
Status: assignedclosed

Edited and applied in hrev46345. In case of error, the newly allocated buffer shall be freed.

Note: See TracTickets for help on using tickets.