8345016: [ASAN] java.c reported ‘%s’ directive argument is null [-Werror=format-truncation=]

Reviewed-by: rriggs
This commit is contained in:
SendaoYan 2025-01-14 01:13:31 +00:00
parent 379d05bcc1
commit 91b63ca748

View file

@ -1018,6 +1018,8 @@ SetClassPath(const char *s)
if (s == NULL)
return;
s = JLI_WildcardExpandClasspath(s);
if (s == NULL)
return;
if (sizeof(format) - 2 + JLI_StrLen(s) < JLI_StrLen(s))
// s is became corrupted after expanding wildcards
return;