change all the sprintf to snprintf to address the potential buffer/stack overflow
[o-du/phy.git] / fhi_lib / lib / src / xran_sync_api.c
index 5b1295f..873c2c1 100644 (file)
@@ -71,7 +71,7 @@ static int is_process_running(char *pname)
         long pid = atol(entry->d_name);\r
         if (0 == pid)\r
             continue;\r
-        sprintf(full_path, "%s/%ld/%s", PROC_DIR, pid, COMM_FILE);\r
+        snprintf(full_path, sizeof(full_path), "%s/%ld/%s", PROC_DIR, pid, COMM_FILE);\r
         FILE *proc_name_file = fopen(full_path, "r");\r
         if (NULL == proc_name_file)\r
             continue;\r