Code Review
/
o-du
/
phy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
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
diff --git
a/fhi_lib/lib/src/xran_sync_api.c
b/fhi_lib/lib/src/xran_sync_api.c
index
5b1295f
..
873c2c1
100644
(file)
--- a/
fhi_lib/lib/src/xran_sync_api.c
+++ b/
fhi_lib/lib/src/xran_sync_api.c
@@
-71,7
+71,7
@@
static int is_process_running(char *pname)
long pid = atol(entry->d_name);
\r
if (0 == pid)
\r
continue;
\r
long pid = atol(entry->d_name);
\r
if (0 == pid)
\r
continue;
\r
- s
printf(full_path
, "%s/%ld/%s", PROC_DIR, pid, COMM_FILE);
\r
+ s
nprintf(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
FILE *proc_name_file = fopen(full_path, "r");
\r
if (NULL == proc_name_file)
\r
continue;
\r