From 89c22508544b2cc8a6a60c0afa40ba6a570a5b97 Mon Sep 17 00:00:00 2001 From: "M. Alexander Perez" Date: Thu, 14 Jun 2018 16:48:00 -0500 Subject: [PATCH] bbcp Seg Fault Fixed issue where bbcp will Seg Fault if it can't resolve host which triggers a strdup(null) call. Tested on RHEL: - Changed hostname by editing the file /etc/sysconfig/network and editing the line that starts with 'HOSTNAME=' - Typed the following commands : echo testfile > ./localfile.txt bbcp ./localfile.txt user@localhost:. --- src/bbcp_Node.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bbcp_Node.C b/src/bbcp_Node.C index 5bab227..4b6acf2 100644 --- a/src/bbcp_Node.C +++ b/src/bbcp_Node.C @@ -187,7 +187,7 @@ int bbcp_Node::Run(char *user, char *host, char *prog, char *parg) // Free up any node name here // if (nodename) free(nodename); - nodename = strdup(host ? host : bbcp_Config.MyHost); + nodename = strdup(host ? host : bbcp_Config.MyHost ? bbcp_Config.MyHost : ""); username = (user ? user : bbcp_Config.MyUser); // Check for an IPV6 address as ssh does not follow the rfc standard