diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2017-07-27 16:07:50 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2017-07-27 16:07:50 -0300 |
commit | 09e241fb1271021e3615512debd3136891547562 (patch) | |
tree | 8245b6084607a34185cfa7d3d45f5228937020f1 /dragonflybsd | |
parent | 3975e9ce5cba0e3972b2ddab28c198e000441501 (diff) |
Security review: check results of snprintf.
Calls marked with xSnprintf shouldn't fail.
Abort program cleanly if any of them does.
Diffstat (limited to 'dragonflybsd')
-rw-r--r-- | dragonflybsd/DragonFlyBSDProcess.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c index 77d709d8..dade106d 100644 --- a/dragonflybsd/DragonFlyBSDProcess.c +++ b/dragonflybsd/DragonFlyBSDProcess.c @@ -118,10 +118,10 @@ void DragonFlyBSDProcess_writeField(Process* this, RichString* str, ProcessField int n = sizeof(buffer) - 1; switch ((int) field) { // add Platform-specific fields here - case PID: snprintf(buffer, n, Process_pidFormat, (fp->kernel ? -1 : this->pid)); break; - case JID: snprintf(buffer, n, Process_pidFormat, fp->jid); break; + case PID: xSnprintf(buffer, n, Process_pidFormat, (fp->kernel ? -1 : this->pid)); break; + case JID: xSnprintf(buffer, n, Process_pidFormat, fp->jid); break; case JAIL:{ - snprintf(buffer, n, "%-11s ", fp->jname); break; + xSnprintf(buffer, n, "%-11s ", fp->jname); break; if (buffer[11] != '\0') { buffer[11] = ' '; buffer[12] = '\0'; |