aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended/rxtx/files/fhs_lock_buffer_overflow_fix.patch
blob: c4d0e89b030b4ca075b6179a4b43e38ebc2d114c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Description: Java fails with a buffer overflow when there's a locked serial
device, see http://mailman.qbang.org/pipermail/rxtx/2009-May/10897125.html.
Author: Sergio Talens-Oliag <sto@debian.org>
Upstream-Status: Pending

Index: rxtx-2.2pre2/CNI/SerialImp.c
===================================================================
--- rxtx-2.2pre2.orig/CNI/SerialImp.c	2012-05-21 13:13:43.000000000 +0200
+++ rxtx-2.2pre2/CNI/SerialImp.c	2012-05-21 13:24:05.876652630 +0200
@@ -4752,7 +4752,7 @@
 	fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
 	if( fd < 0 )
 	{
-		sprintf( message,
+		snprintf( message, 79,
 			"RXTX fhs_lock() Error: creating lock file: %s: %s\n",
 			file, strerror(errno) );
 		report_error( message );
Index: rxtx-2.2pre2/src/SerialImp.c
===================================================================
--- rxtx-2.2pre2.orig/src/SerialImp.c	2012-05-21 13:13:43.000000000 +0200
+++ rxtx-2.2pre2/src/SerialImp.c	2012-05-21 13:26:50.184644233 +0200
@@ -5307,7 +5307,7 @@
 	}
 	if ( dev_lock( filename ) )
 	{
-		sprintf( message,
+		snprintf( message, 79,
 			"RXTX fhs_lock() Error: creating lock file for: %s: %s\n",
 			filename, strerror(errno) );
 		report_error( message );
@@ -5367,7 +5367,7 @@
 	fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
 	if( fd < 0 )
 	{
-		sprintf( message,
+		snprintf( message, 79,
 			"RXTX fhs_lock() Error: creating lock file: %s: %s\n",
 			file, strerror(errno) );
 		report_error( message );
Index: rxtx-2.2pre2/src/lfd/lockdaemon.c
===================================================================
--- rxtx-2.2pre2.orig/src/lfd/lockdaemon.c	2007-04-26 07:26:07.000000000 +0200
+++ rxtx-2.2pre2/src/lfd/lockdaemon.c	2012-05-21 13:25:35.396648055 +0200
@@ -145,7 +145,7 @@
 	fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
 	if( fd < 0 )
 	{
-		sprintf( message,
+		snprintf( message, 79,
 			"RXTX fhs_lock() Error: creating lock file: %s: %s\n",
 			file, strerror(errno) );
 		syslog( LOG_INFO, message );
Index: rxtx-2.2pre2/src/lfd/lockdaemon.c.noinetd
===================================================================
--- rxtx-2.2pre2.orig/src/lfd/lockdaemon.c.noinetd	2007-04-26 07:26:07.000000000 +0200
+++ rxtx-2.2pre2/src/lfd/lockdaemon.c.noinetd	2012-05-21 13:25:55.748647017 +0200
@@ -144,7 +144,7 @@
 	fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
 	if( fd < 0 )
 	{
-		sprintf( message,
+		snprintf( message, 79,
 			"RXTX fhs_lock() Error: creating lock file: %s: %s\n",
 			file, strerror(errno) );
 		syslog( LOG_INFO, message );