YARN-7014. Fix off-by-one error causing heap corruption (Jason Lowe via nroberts)
(cherry picked from commit d265459024
)
This commit is contained in:
parent
4647761341
commit
1d33290a0a
|
@ -44,8 +44,7 @@ int validate_container_id(const char* input) {
|
||||||
* container_e17_1410901177871_0001_01_000005
|
* container_e17_1410901177871_0001_01_000005
|
||||||
* container_1410901177871_0001_01_000005
|
* container_1410901177871_0001_01_000005
|
||||||
*/
|
*/
|
||||||
char* input_cpy = malloc(strlen(input));
|
char* input_cpy = strdup(input);
|
||||||
strcpy(input_cpy, input);
|
|
||||||
char* p = strtok(input_cpy, "_");
|
char* p = strtok(input_cpy, "_");
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
while (p != NULL) {
|
while (p != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue