Michael Brown
2b4be69eee
[libc] Prevent strndup() from reading beyond the end of the string
...
strndup() may be called on a string which is not NUL-terminated. Use
strnlen() instead of strlen() to ensure that we do not read beyond the
end of such a string.
Add self-tests for strndup(), including a test case with an
unterminated string.
Originally-fixed-by: Marin Hannache <git@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-05-18 21:09:49 +01:00
Michael Brown
c44a193d0d
[legal] Add a selection of FILE_LICENCE declarations
...
Add FILE_LICENCE declarations to almost all files that make up the
various standard builds of gPXE.
2009-05-18 08:33:25 +01:00
Holger Lubitz
bb94c143d9
move strndup back to string.c - used by strdup
2007-08-02 01:48:20 +02:00
Holger Lubitz
c9c97b3444
stripped down version of string.c containing only the used functions
2007-08-02 00:27:37 +02:00
Holger Lubitz
f397fc443c
make bcopy use memmove
2007-07-29 17:35:38 +02:00
Michael Brown
e330db3c74
Dead code removal.
...
Kill off use of etherboot.h outside drivers/net.
2007-07-14 15:42:26 +01:00
Michael Brown
7137c20ed1
Add strcspn() and strndup()
2007-07-08 22:03:12 +01:00
Michael Brown
afe4e011ac
Move tolower() etc to ctype.h as per ISO C
2007-01-26 03:25:19 +00:00
Michael Brown
496563071d
Added strdup()
2006-12-08 00:34:47 +00:00
Michael Brown
3d6123e69a
Initial revision
2005-03-08 18:53:11 +00:00