summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2014-11-09Correct constness of str*unvis()'s second (source) argumentPhilip Guenther
2014-11-05missing pfd = newp, diagnosed by deraadt@Stuart Henderson
2014-11-05edns0 is not currently supported: confirmed by sthen and ericJason McIntyre
diff From: Mike Burns (though my fix differs a bit)
2014-11-05zap double word;Jason McIntyre
2014-11-05Convert EXAMPLES to IDIOMS and make it a simple select -> pollTodd C. Miller
conversion along with commentary. A more comprehensive sample conversion is needed too. OK deraadt@
2014-11-04explicitly clarify that reading also stops after size-1 bytesTed Unangst
2014-11-04Fix memory leak on reallocarray() failure introduced by conversionTodd C. Miller
from calloc().
2014-11-03POLLERR is only valid in revents so it is not a bug that it isTodd C. Miller
ignored in events. The kernel does actually set POLLERR in revents in some cases.
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@