#18349 closed bug (fixed)
getlogin_r return value is wrong in case of too small buffer
Reported by: | bhaible | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | - General | Version: | R1/beta4 |
Keywords: | r1beta4-fixes | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin_r.html> specifies that when getlogin_r fails due to a too small buffer passed as argument, the return value is ERANGE:
"[ERANGE]
The value of namesize is smaller than the length of the string to be returned including the terminating null character."
But Haiku r1beta4 returns ENOMEM instead.
How to reproduce (on x86_64):
$ gcc -Wall -ggdb foo.c $ ./a.out err = 0 err = -2147483648 = Out of memory err = -2147483648 = Out of memory err = -2147483648 = Out of memory
Attachments (1)
Change History (5)
by , 21 months ago
comment:1 by , 21 months ago
Milestone: | Unscheduled → R1/beta5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in hrev56905.
comment:2 by , 21 months ago
Milestone: | R1/beta5 → R1/beta4 |
---|
cherry-picked to r1beta4 branch. Next update should include.
comment:3 by , 21 months ago
Milestone: | R1/beta4 → R1/beta5 |
---|
comment:4 by , 21 months ago
Keywords: | r1beta4-fixes added |
---|
Note:
See TracTickets
for help on using tickets.
test case