Don't try to read past the end of header string fields

* src/common.h (assign_string_n): New proto.
(ASSIGN_STRING_N): New macro.
* src/misc.c (assign_string_n): New function.
* gnulib.modules: Add strnlen.
* src/buffer.c: Use assign_string_n where appropriate.
* src/list.c: Likewise.
This commit is contained in:
Sergey Poznyakoff
2018-11-24 17:49:25 +02:00
parent f6e2860e8a
commit ba472050da
5 changed files with 28 additions and 18 deletions

View File

@@ -85,6 +85,7 @@ stdint
stpcpy
strdup-posix
strerror
strnlen
strtoimax
strtol
strtoul