Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a5966b9 authored by Christopher Ferris's avatar Christopher Ferris Committed by Gerrit Code Review
Browse files

Merge "Change sprintf to snprintf calls."

parents 72031ab8 b8c72957
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -108,11 +108,11 @@ bool BacktraceMap::Build() {

#if defined(__APPLE__)
  // 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");
#else
  // 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");
#endif
  if (fp == NULL) {