mirror of
https://github.com/openwrt/openwrt.git
synced 2025-04-09 20:31:59 +00:00
busybox: Fix snprintf arguments in lock
The first argument for snprintf is the buffer and the 2. one is the size. Fix the order. This broke the lock application. Fixes: 9d2b26d5a705 ("busybox: fix busybox lock applet pidstr buffer overflow") Reported-by: Hartmut Birr <e9hack@gmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (cherry picked from commit d80336e1a970b088c235dcf2773052537e6f5d72)
This commit is contained in:
parent
9d2b26d5a7
commit
d18e365b17
@ -109,7 +109,7 @@
|
||||
+ if (!waitonly) {
|
||||
+ lseek(fd, 0, SEEK_SET);
|
||||
+ ftruncate(fd, 0);
|
||||
+ snprintf(sizeof(pidstr), pidstr, "%d\n", pid);
|
||||
+ snprintf(pidstr, sizeof(pidstr), "%d\n", pid);
|
||||
+ write(fd, pidstr, strlen(pidstr));
|
||||
+ close(fd);
|
||||
+ }
|
||||
|
Loading…
x
Reference in New Issue
Block a user