8333178: ubsan: jvmti_tools.cpp:149:16: runtime error: null pointer passed as argument 2, which is declared to never be null
Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
parent
c7d2841fb4
commit
880c6b42ba
@ -146,7 +146,9 @@ static int add_option(const char opt[], int opt_len, const char val[], int val_l
|
|||||||
} else {
|
} else {
|
||||||
strncpy(name, opt, opt_len);
|
strncpy(name, opt, opt_len);
|
||||||
name[opt_len] = '\0';
|
name[opt_len] = '\0';
|
||||||
|
if (val != nullptr) {
|
||||||
strncpy(value, val, val_len);
|
strncpy(value, val, val_len);
|
||||||
|
}
|
||||||
value[val_len] = '\0';
|
value[val_len] = '\0';
|
||||||
|
|
||||||
if (!check_option(dashed_opt, name, value)) {
|
if (!check_option(dashed_opt, name, value)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user