diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-04-20 14:28:39 -0400 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-04-20 19:14:33 -0400 |
| commit | 2b7165e76f78b4b92e7ec09de26d96c3e0c5849f (patch) | |
| tree | 8835752ea32b4c6b2c2900749b5992cb8f1785b7 /tools/start-stop-daemon.c | |
| parent | fc746f1c01daf34600d83293647199e81fcb8316 (diff) | |
*: use appropriate buffer sizes, specifiers
- Fix 1 byte overflow when showing GR info in bgpd
- Use PATH_MAX for path buffers
- Use unsigned specifiers for uint16_t's in zebra pbr
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'tools/start-stop-daemon.c')
| -rw-r--r-- | tools/start-stop-daemon.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c index ba40a02f50..7ad2a84500 100644 --- a/tools/start-stop-daemon.c +++ b/tools/start-stop-daemon.c @@ -605,7 +605,7 @@ static void parse_options(int argc, char *const *argv) static int pid_is_exec(pid_t pid, const struct stat *esb) { struct stat sb; - char buf[32]; + char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "/proc/%ld/exe", (long)pid); if (stat(buf, &sb) != 0) @@ -617,7 +617,7 @@ static int pid_is_exec(pid_t pid, const struct stat *esb) static int pid_is_user(pid_t pid, uid_t uid) { struct stat sb; - char buf[32]; + char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "/proc/%ld", (long)pid); if (stat(buf, &sb) != 0) @@ -628,7 +628,7 @@ static int pid_is_user(pid_t pid, uid_t uid) static int pid_is_cmd(pid_t pid, const char *name) { - char buf[32]; + char buf[PATH_MAX]; FILE *f; int c; |
