8252997: Null-proofing for linker_md.c
Reviewed-by: sspitsyn
This commit is contained in:
parent
97ff38caff
commit
4dfa411247
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -49,11 +49,12 @@ static void dll_build_name(char* buffer, size_t buflen,
|
|||||||
*buffer = '\0';
|
*buffer = '\0';
|
||||||
|
|
||||||
paths_copy = jvmtiAllocate((int)strlen(paths) + 1);
|
paths_copy = jvmtiAllocate((int)strlen(paths) + 1);
|
||||||
strcpy(paths_copy, paths);
|
|
||||||
if (paths_copy == NULL) {
|
if (paths_copy == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strcpy(paths_copy, paths);
|
||||||
|
|
||||||
next_token = NULL;
|
next_token = NULL;
|
||||||
path = strtok_r(paths_copy, PATH_SEPARATOR, &next_token);
|
path = strtok_r(paths_copy, PATH_SEPARATOR, &next_token);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -46,11 +46,12 @@ static void dll_build_name(char* buffer, size_t buflen,
|
|||||||
*buffer = '\0';
|
*buffer = '\0';
|
||||||
|
|
||||||
paths_copy = jvmtiAllocate((int)strlen(paths) + 1);
|
paths_copy = jvmtiAllocate((int)strlen(paths) + 1);
|
||||||
strcpy(paths_copy, paths);
|
|
||||||
if (paths_copy == NULL) {
|
if (paths_copy == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strcpy(paths_copy, paths);
|
||||||
|
|
||||||
next_token = NULL;
|
next_token = NULL;
|
||||||
path = strtok_s(paths_copy, PATH_SEPARATOR, &next_token);
|
path = strtok_s(paths_copy, PATH_SEPARATOR, &next_token);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user