Skip to content

Commit 3012b51

Browse files
Replace another occurrence of strncpy with memcpy
* Replaced another line in jni_helper.c where the destination string that was copied by strncpy would contain a non-null terminated string.
1 parent 9858cfc commit 3012b51

File tree

1 file changed

+1
-1
lines changed
  • hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs

1 file changed

+1
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs/jni_helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ static ssize_t getClassPath_helper(const char *classpath, char* expandedClasspat
536536
// +1 for path separator or null terminator
537537
length += tokenlen + 1;
538538
if (expandedCP_curr != NULL) {
539-
strncpy(expandedCP_curr, cp_token, tokenlen);
539+
memcpy(expandedCP_curr, cp_token, tokenlen);
540540
expandedCP_curr += tokenlen;
541541
*expandedCP_curr = PATH_SEPARATOR;
542542
expandedCP_curr++;

0 commit comments

Comments
 (0)