aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-04-11 13:54:43 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-04-11 13:54:43 +0000
commit39eb9b16cbf4257e423662c2fa09f439e92ca5ef (patch)
tree6fe01d47224424a4fdf57fa4e66b1e7e3a663c5e
parente8e55bc436d1d0e7a5210806fe3ea4b6c890cb19 (diff)
downloadupstream-39eb9b16cbf4257e423662c2fa09f439e92ca5ef.tar.gz
upstream-39eb9b16cbf4257e423662c2fa09f439e92ca5ef.tar.bz2
upstream-39eb9b16cbf4257e423662c2fa09f439e92ca5ef.zip
fix segfault in locking utility
SVN-Revision: 3617
-rw-r--r--openwrt/package/busybox/patches/340-lock_util.patch7
1 files changed, 5 insertions, 2 deletions
diff --git a/openwrt/package/busybox/patches/340-lock_util.patch b/openwrt/package/busybox/patches/340-lock_util.patch
index f5c0c2e89e..bb1cf49a77 100644
--- a/openwrt/package/busybox/patches/340-lock_util.patch
+++ b/openwrt/package/busybox/patches/340-lock_util.patch
@@ -39,7 +39,7 @@ diff -urN busybox.old/miscutils/Makefile.in busybox.dev/miscutils/Makefile.in
diff -urN busybox.old/miscutils/lock.c busybox.dev/miscutils/lock.c
--- busybox.old/miscutils/lock.c 1970-01-01 01:00:00.000000000 +0100
+++ busybox.dev/miscutils/lock.c 2006-04-05 01:07:12.000000000 +0200
-@@ -0,0 +1,125 @@
+@@ -0,0 +1,128 @@
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/stat.h>
@@ -77,10 +77,13 @@ diff -urN busybox.old/miscutils/lock.c busybox.dev/miscutils/lock.c
+ FILE *f;
+ int i;
+
-+ f = fopen(file, "r");
++ if ((f = fopen(file, "r")) == NULL)
++ return 0;
++
+ fscanf(f, "%d", &i);
+ if (i > 0)
+ kill(i, SIGTERM);
++
+ fclose(f);
+
+ return 0;