mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Fixes a potential buffer overflow with the pid filename.
Submitted by: Mike Heffner <spock@techfour.net> Submitted on: audit@freebsd.org
This commit is contained in:
parent
30395bb5f1
commit
dee921f457
1 changed files with 3 additions and 1 deletions
|
|
@ -214,7 +214,9 @@ main(argc, argv)
|
|||
dvname = devicename;
|
||||
else
|
||||
dvname++;
|
||||
sprintf(pidfile, PIDFILE, _PATH_VARRUN, dvname);
|
||||
if (snprintf(pidfile, sizeof(pidfile), PIDFILE, _PATH_VARRUN, dvname) >= sizeof(pidfile))
|
||||
usage();
|
||||
|
||||
if ((pfd = fopen(pidfile, "r")) != NULL) {
|
||||
if (fscanf(pfd, "%ld\n", &lpid) == 1) {
|
||||
pid = lpid;
|
||||
|
|
|
|||
Loading…
Reference in a new issue