Hi,

commit

busybox: fix busybox lock applet pidstr buffer overflow

looks wrong for me:

--- 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);
-+                      sprintf(pidstr, "%d\n", pid);
++                      snprintf(sizeof(pidstr), pidstr, "%d\n", pid);
 +                      write(fd, pidstr, strlen(pidstr));
 +                      close(fd);
 +              }

The first parameter in snprintf() must be the buffer and the second the length.

Regards,
Hartmut

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to