diff --git a/src/lib/eina/eina_log.c b/src/lib/eina/eina_log.c index c08f93cc0a..65bfbb89ac 100644 --- a/src/lib/eina/eina_log.c +++ b/src/lib/eina/eina_log.c @@ -1021,9 +1021,12 @@ eina_log_domain_parse_pending_globs(void) level = strtol((char *)(end + 1), &tmp, 10); if (tmp == (end + 1)) goto parse_end; - + // If the name of the log is more than 64k it's silly so give up + // as it's pointless and in theory could overflow pointer + if ((end - start) > 0xffff) + break; // Parse name - p = malloc(sizeof(Eina_Log_Domain_Level_Pending) + end - start + 1); + p = malloc(sizeof(Eina_Log_Domain_Level_Pending) + (end - start) + 1); if (!p) break;