aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2022-03-31 18:43:09 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-03-31 18:46:53 +0200
commitd80336e1a970b088c235dcf2773052537e6f5d72 (patch)
tree8b34a0494e2339ef748e5d6e9f79ba356d026181
parentc6eb63d48f942f1e54737ed182776cf9a08de542 (diff)
downloadupstream-d80336e1a970b088c235dcf2773052537e6f5d72.tar.gz
upstream-d80336e1a970b088c235dcf2773052537e6f5d72.tar.bz2
upstream-d80336e1a970b088c235dcf2773052537e6f5d72.zip
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: 34567750db2c ("busybox: fix busybox lock applet pidstr buffer overflow") Reported-by: Hartmut Birr <e9hack@gmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--package/utils/busybox/patches/220-add_lock_util.patch2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch
index 623121b9fb..579b705f34 100644
--- a/package/utils/busybox/patches/220-add_lock_util.patch
+++ b/package/utils/busybox/patches/220-add_lock_util.patch
@@ -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);
+ }