From 264ddb13ff7455282fb640b6ff6c565adddea44e Mon Sep 17 00:00:00 2001 From: Daniel Templeton Date: Tue, 15 Nov 2016 13:01:57 -0800 Subject: [PATCH] YARN-5736 Addendum. Fixes segfault due to unterminated string. (Contributed by Miklos Szegedi via Daniel Templeton) --- .../src/main/native/container-executor/impl/configuration.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c index 8da7d24339..a6d7a9ce33 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/configuration.c @@ -156,6 +156,7 @@ char* trim(char* input) } strncpy(ret, val_begin, val_end - val_begin); + ret[val_end - val_begin] = '\0'; return ret; }