diff options
author | Yuan-Hsiang Lee <yhlee@ubnt.com> | 2013-11-03 00:13:16 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-11-03 00:13:16 +0100 |
commit | b21bc80c7651bfb5a9e001cc220a598cf89b7cfd (patch) | |
tree | 1b8554170fa9cb14990706a29899d1fa004e566c /init | |
parent | 18b461925c6297f241c2b51f96f5d6d5f5de9e1d (diff) | |
download | busybox-w32-b21bc80c7651bfb5a9e001cc220a598cf89b7cfd.tar.gz busybox-w32-b21bc80c7651bfb5a9e001cc220a598cf89b7cfd.tar.bz2 busybox-w32-b21bc80c7651bfb5a9e001cc220a598cf89b7cfd.zip |
init: fix illegal memory access when max message length is reached
Signed-off-by: Yuan-Hsiang Lee <yhlee@ubnt.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'init')
-rw-r--r-- | init/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c index cc6a2b5be..2dcdfd471 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -222,8 +222,8 @@ static void message(int where, const char *fmt, ...) | |||
222 | msg[0] = '\r'; | 222 | msg[0] = '\r'; |
223 | va_start(arguments, fmt); | 223 | va_start(arguments, fmt); |
224 | l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments); | 224 | l = 1 + vsnprintf(msg + 1, sizeof(msg) - 2, fmt, arguments); |
225 | if (l > sizeof(msg) - 1) | 225 | if (l > sizeof(msg) - 2) |
226 | l = sizeof(msg) - 1; | 226 | l = sizeof(msg) - 2; |
227 | va_end(arguments); | 227 | va_end(arguments); |
228 | 228 | ||
229 | #if ENABLE_FEATURE_INIT_SYSLOG | 229 | #if ENABLE_FEATURE_INIT_SYSLOG |