Summary: | strnlen() accesses memory locations beyond (s + maxlen) | ||
---|---|---|---|
Product: | glibc | Reporter: | Kris Van Hees <kris.van.hees> |
Component: | libc | Assignee: | Ulrich Drepper <drepper.fsp> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | glibc-bugs |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Last reconfirmed: | |
Attachments: | Patch for strnlen() illegal access problem |
Description
Kris Van Hees
2006-10-12 14:50:36 UTC
Created attachment 1372 [details]
Patch for strnlen() illegal access problem
This patch resolves the two issues mentioned in the bug report. The
performance impact of the changes should be minimal.
This is by design. The application cannot see any difference. There never will be any segfaults because of that. If this is by design, I'll see check to log a bug against the manpage for strnlen (at least on linux, haven't check manpage for other ports) because the manpage currently explicitly states: The strnlen function returns the number of characters in the string pointed to by s, not including the terminating '\0' character, but at most maxlen. In doing this, strnlen looks only at the first maxlen characters at s and never beyond s+maxlen. That last sentence is clearly not in sync with the implementation. There is no bug anywhere except in your understanding what the runtime is supposed to do. |