summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2014-11-02Fix a NULL deref when getting an actual result for an invalid hostnameEric Faurot
in gethostbyname(). Similar fix for getnetbyname(). ok deraadt@ daniel@ jca@
2014-10-31Use "const char tempchars[]" instead of "const char *tempchars".Todd C. Miller
Since tempchars is never reassigned there's no need to indirect through a pointer. Still getting used to this newfangled C89.
2014-10-30clean up verbiage around the calculations; ok ingo jmc ottoTheo de Raadt
2014-10-30Don't mention old systems where realloc(NULL, n) didn't work as weTodd C. Miller
don't want to give people the idea that this is non-portable (it has been present since C89). OK deraadt@ schwarze@
2014-10-26The open flags param to mkostemps() should be "flags" not "oflags"Todd C. Miller
for consistency with the rest of the manual.
2014-10-26mknod(2) now supports creating FIFOs too. Fix description of device filePhilip Guenther
creation while here. ok jmc@ schwarze@ millert@
2014-10-25Remove unnecessary netinet/in_systm.h include.Lawrence Teo
ok millert@
2014-10-23Save space in man page: err() -> errc() and combine vars.Doug Hogan
Suggested by millert@ and schwarze@. OK schwarze@, millert@
2014-10-22We prefer to use call reallocarray() with nmemb first and size second.Todd C. Miller
Requested by guenther@
2014-10-22Use reallocarray() instead of calloc() (originally was realloc).Todd C. Miller
OK deraadt@
2014-10-22Avoid writing in second person in malloc.3Doug Hogan
ok deraadt@
2014-10-20List extensions in the STANDARDS section, replacing some text below CAVEATS.Ingo Schwarze
Remove excessive technicalities on zero-sized objects as suggested by deraadt@. contributions and ok deraadt@, ok jmc@ on an earlier version
2014-10-19make RETURN VALUES more conciseIngo Schwarze
and fix two instances of "new sentence, new line" while here feedback and ok jmc@, ok doug@
2014-10-19Revamp malloc.3 by reordering the sections and rewriting parts.Doug Hogan
The old man page had a lot of useful information, but it was all mixed together which made it difficult to reference. The main theme in this commit is that the sections are more focused: * DESCRIPTION describes the overall behavior * RETURN VALUES describes what it may return (including implementation defined values) * EXAMPLES shows why we recently started an audit on malloc and realloc usage in the tree. * Added CAVEATS which describes what is implementation defined, gotchas and security implications of misusing these functions * Added IDIOMS which describes how these functions should or should not be used The MALLOC_OPTIONS section was left unchanged. Function names were added to DIAGNOSTICS and STANDARDS. The MALLOC_OPTIONS and DIAGNOSTICS sections were pushed down in the page so more pertinent information is higher up. This has gone through several revisions thanks to input from deraadt@ and schwarze@. Ingo also helped with some of the mandoc formatting. OK schwarze@ (as far as it is a good starting point and the code snippets look ok)
2014-10-19Revert last commit due to changed semantics found by make release.Doug Hogan
2014-10-18Better POSIX compliance in realpath(3).Doug Hogan
millert@ made changes to realpath.c based on FreeBSD's version. I merged Todd's changes into dl_realpath.c. ok millert@, guenther@
2014-10-18reallocarray() -- a little tricky to reviewTheo de Raadt
ok doug millert
2014-10-17trivial sync of the first sentence of the DESCRIPTIONIngo Schwarze
with btree(3) and recno(3); from jean-philippe at ouellet dot biz
2014-10-16Fix bounds check for newlen without relying on unspecified behavior.Todd C. Miller
OK deraadt@
2014-10-16Remove references to unimplemented CLOCK_VIRTUAL. It is non-standardTodd C. Miller
and existing implementations vary as to whether it returns time for the calling thread or the entire process. OK kettenis@
2014-10-13remove unused variableCharles Longeau
ok tedu@
2014-10-11Since deraadt@ remembers seeing strdup() on one particular 4.2BSD machine,Ingo Schwarze
i looked a bit closer and found instances before Reno, so correct HISTORY. References: http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.1cBSD/usr/src/ucb/dbx/defs.h http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD/usr/src/etc/inetd.c http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD-Reno/src/lib/libc/string/strdup.c ok deraadt@
2014-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-10-11obvious reallocarray() useTheo de Raadt
ok doug
2014-10-11use reallocarray, and avoid this << 1 ugliness.Theo de Raadt
ok doug
2014-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-10-11Add UTC support to %Z conversion in strptime().Doug Hogan
Patch from jmates at ee dot washington dot edu. ok otto@, millert@
2014-10-10replace select with equiv poll usage.David Gwynne
looks good deraadt@ tweaks and ok millert@
2014-10-10Remove unnecessary includes now that we are no longer using select()Todd C. Miller
(or struct timeval). Instead, we should include time.h for the nanosleep() prototype and struct timespec. OK dlg@
2014-10-09replace the use of select() for a short sleep with nanosleep().David Gwynne
ok deraadt@ guenther@
2014-10-09use reallocarray(NULL, a, b) instead of malloc(a, b), which gives usTheo de Raadt
proper mult int overflow detection. The existing code already handles malloc failure properly, of course.
2014-10-08obvious realloc -> reallocarray conversionTheo de Raadt
2014-10-08obvious reallocarray()Theo de Raadt
2014-10-08using reallocarray() gives us multiplicative integer overflow checkingTheo de Raadt
in case something wants to create massive amounts of environment, like a bit more than 1/4 of a 32-bit address space. unrealistic -- but why audit one code path, and not treat others the same? then you have to re-engage everytime you see the code. read the news, that isn't what developers do. At least if the code paths look the same, there is hope, because they are easier to verify for correctness. developers need to give other developers a chance to want to care.
2014-10-08obvious conversion of realloc() to reallocarray(). Luckily this isTheo de Raadt
using pollfd, because if this was fd_set... it would not be obvious (or easy)
2014-10-08obvious reallocarray(); ok dougTheo de Raadt
2014-10-08obvious malloc -> reallocarray, for mult int oflowTheo de Raadt
2014-10-08reallocarray() to detect potential int overflow; ok dougTheo de Raadt
2014-10-08reallocarray() for mult int overflow detect; ok dougTheo de Raadt
2014-10-03Strip trailing new-lines from syslog messages. This avoids emptyAlexander Bluhm
lines when printing to console or stderr. OK deraadt@
2014-10-02Fix a crash when there is text after a failed %Z conversion in strptime.Doug Hogan
jmates at ee dot washington dot edu reported this bug and provided a patch. This is a slightly modified version of the patch that only contains the bug fix. ok millert@, otto@
2014-09-15We missed a hyphen in 'async-signal-safe'Philip Guenther
Noted by Jean-Philippe Ouellet (jean-philippe (at) ouellet.biz)
2014-09-15When fopen()ing internal to libc (the API doesn't support the usePhilip Guenther
of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@
2014-09-15Pass O_CLOEXEC to open() or mkostemp() instead of setting FD_CLOEXEC afterwardsPhilip Guenther
ok miod@
2014-09-15Use _PATH_NETWORKS for "/etc/networks"Philip Guenther
ok miod@
2014-09-15Mention that SIGTHR is both local and weirdPhilip Guenther
"seems fair" schwarze@
2014-09-14Do not claim that empty numbers set EINVAL, our implementation doesn't.Ingo Schwarze
Mention that invalid bases do set EINVAL (as required by POSIX); this part of the change uses part of an earlier patch by millert@. Minor mdoc(7) cleanup and sync between the two pages while here. Feedback and ok jmc@ and millert@.
2014-09-13Make sure that the following functions return 0 and EINVAL asIngo Schwarze
required by the C standard when called with an invalid base: strtoll(), strtoimax(), strtoul(), strtoull(), and strtoumax(). Same behaviour for strtoq() and strtouq() even though not standardized. No functional change in strtol(), it was the only one already correct. While here, simplify the conditional expression for checking the base and sync whitespace and comments among the six files. ok millert@
2014-09-12Fix some bugs in the _Qp_sqrt implementation that would limit the accuracyMark Kettenis
of the result in many cases. From FreeBSD allbeit with some changes to keep the coding style consistent. This fixes the asinhl(4) issue reported by dickman@ on tech@.