mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-31 23:15:48 +03:00
Fix potential index out of bounds
This commit is contained in:
1 parent
7a5d13acec
commit
4dc295f7e9
1 file changed
+1
-1
+1
-1
@@ -1220,7 +1220,7 @@ coap_log_impl(coap_log_t level, const char *format, ...) {
|
||||
if (len)
|
||||
fprintf(log_fd, "%.*s ", (int)len, timebuf);
|
||||
|
||||
if (level > sizeof(loglevels)/sizeof(loglevels[0])) {
|
||||
if (level >= sizeof(loglevels)/sizeof(loglevels[0])) {
|
||||
fprintf(log_fd, "%4d ", level);
|
||||
} else {
|
||||
fprintf(log_fd, "%s ", loglevels[level]);
|
||||
|
||||
Reference in new issue
Block a user