1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Fix: Handle invalid error entries in error_get_by_uuid

This commit is contained in:
Marvin Scholz 2020-09-04 02:06:09 +02:00
parent d22ce7b95d
commit c1ce1de619

View File

@ -10,6 +10,7 @@
#include <config.h> #include <config.h>
#endif #endif
#include <assert.h>
#include <strings.h> #include <strings.h>
#include "errors.h" #include "errors.h"
@ -232,7 +233,9 @@ const icecast_error_t * error_get_by_uuid(const char *uuid)
size_t i; size_t i;
for (i = 0; i < (sizeof(__errors)/sizeof(*__errors)); i++) { for (i = 0; i < (sizeof(__errors)/sizeof(*__errors)); i++) {
if (strcasecmp(__errors[i].uuid, uuid) == 0) { assert(__errors[i].uuid);
if (__errors[i].uuid && strcasecmp(__errors[i].uuid, uuid) == 0) {
return &(__errors[i]); return &(__errors[i]);
} }
} }