* commit '8c526578f4c54eb295635f0e9f4620fb41296f44': Change sprintf to snprintf calls.
This commit is contained in:
commit
e36152308d
1 changed files with 2 additions and 2 deletions
|
|
@ -108,11 +108,11 @@ bool BacktraceMap::Build() {
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// cmd is guaranteed to always be big enough to hold this string.
|
// cmd is guaranteed to always be big enough to hold this string.
|
||||||
sprintf(cmd, "vmmap -w -resident -submap -allSplitLibs -interleaved %d", pid_);
|
snprintf(cmd, sizeof(cmd), "vmmap -w -resident -submap -allSplitLibs -interleaved %d", pid_);
|
||||||
FILE* fp = popen(cmd, "r");
|
FILE* fp = popen(cmd, "r");
|
||||||
#else
|
#else
|
||||||
// path is guaranteed to always be big enough to hold this string.
|
// path is guaranteed to always be big enough to hold this string.
|
||||||
sprintf(path, "/proc/%d/maps", pid_);
|
snprintf(path, sizeof(path), "/proc/%d/maps", pid_);
|
||||||
FILE* fp = fopen(path, "r");
|
FILE* fp = fopen(path, "r");
|
||||||
#endif
|
#endif
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue