Commit Graph

9 Commits

Author SHA1 Message Date
wiz
4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
kleink
3432ed7203 Need an internal name for asprintf(3). 2001-04-13 14:18:09 +00:00
mycroft
442e96d230 Initialize f._file for locking primitives. 2000-01-21 19:51:36 +00:00
lukem
d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem
b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
christos
e7f7fdba9a delint 1998-11-15 17:19:53 +00:00
mycroft
ef3079f0ee Make sure we free the buffer in all error cases.
Do the final realloc(3) to the size of the string, not the size of the buffer
allocated for the string (which is a noop).
1998-10-15 07:36:09 +00:00
kleink
83d4043d4c s/NULL/NUL/ where appropriate. 1998-09-08 14:13:36 +00:00
perry
253ef37df2 add asprintf and vasprintf, originally written by Todd Miller for OpenBSD 1998-08-28 21:33:10 +00:00