File: fix_segfault

package info (click to toggle)
libopenobex 1.7.2-2.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 984 kB
  • sloc: ansic: 9,988; xml: 407; makefile: 29
file content (20 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Fix segfault in obex-check-device
Bug-Debian: https://bugs.debian.org/825106
Forwarded: https://gitlab.com/openobex/mainline/-/merge_requests/2/diffs?commit_id=8e30bff036a47ca27c4f41d14f40f6a0fb9cba06
Last-Update: <2021-10-04>

diff --git a/udev/obex-check-device.c b/udev/obex-check-device.c
index 9eb4769..df160ca 100644
--- a/udev/obex-check-device.c
+++ b/udev/obex-check-device.c
@@ -62,8 +62,8 @@ int main (int argc, char **argv)
 	unsigned long vendor;
 	unsigned long product;
 
-	if (argc < 2)
-		return 0;
+	if (argc < 3)
+		return EXIT_FAILURE;
 
 	vendor = strtoul(argv[1], NULL, 16);
 	product = strtoul(argv[2], NULL, 16);