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: 34567750db
("busybox: fix busybox lock applet pidstr buffer overflow")
Reported-by: Hartmut Birr <e9hack@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
parent
c6eb63d48f
commit
d80336e1a9
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@
|
||||||
+ if (!waitonly) {
|
+ if (!waitonly) {
|
||||||
+ lseek(fd, 0, SEEK_SET);
|
+ lseek(fd, 0, SEEK_SET);
|
||||||
+ ftruncate(fd, 0);
|
+ ftruncate(fd, 0);
|
||||||
+ snprintf(sizeof(pidstr), pidstr, "%d\n", pid);
|
+ snprintf(pidstr, sizeof(pidstr), "%d\n", pid);
|
||||||
+ write(fd, pidstr, strlen(pidstr));
|
+ write(fd, pidstr, strlen(pidstr));
|
||||||
+ close(fd);
|
+ close(fd);
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Reference in a new issue