Debian Codegraph @

debian/patches/fhs_lock_buffer_overflow_fix.patch

raw
1 Description: Java fails with a buffer overflow when there's a locked serial
2 device, see http://mailman.qbang.org/pipermail/rxtx/2009-May/10897125.html.
3 Author: Sergio Talens-Oliag <[email protected]>
4
5 Index: rxtx-2.2pre2/CNI/SerialImp.c
6 ===================================================================
7 --- rxtx-2.2pre2.orig/CNI/SerialImp.c 2012-05-21 13:13:43.000000000 +0200
8 +++ rxtx-2.2pre2/CNI/SerialImp.c 2012-05-21 13:24:05.876652630 +0200
9 @@ -4752,7 +4752,7 @@
10 fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
11 if( fd < 0 )
12 {
13 - sprintf( message,
14 + snprintf( message, 79,
15 "RXTX fhs_lock() Error: creating lock file: %s: %s\n",
16 file, strerror(errno) );
17 report_error( message );
18 Index: rxtx-2.2pre2/src/SerialImp.c
19 ===================================================================
20 --- rxtx-2.2pre2.orig/src/SerialImp.c 2012-05-21 13:13:43.000000000 +0200
21 +++ rxtx-2.2pre2/src/SerialImp.c 2012-05-21 13:26:50.184644233 +0200
22 @@ -5307,7 +5307,7 @@
23 }
24 if ( dev_lock( filename ) )
25 {
26 - sprintf( message,
27 + snprintf( message, 79,
28 "RXTX fhs_lock() Error: creating lock file for: %s: %s\n",
29 filename, strerror(errno) );
30 report_error( message );
31 @@ -5367,7 +5367,7 @@
32 fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
33 if( fd < 0 )
34 {
35 - sprintf( message,
36 + snprintf( message, 79,
37 "RXTX fhs_lock() Error: creating lock file: %s: %s\n",
38 file, strerror(errno) );
39 report_error( message );
40 Index: rxtx-2.2pre2/src/lfd/lockdaemon.c
41 ===================================================================
42 --- rxtx-2.2pre2.orig/src/lfd/lockdaemon.c 2007-04-26 07:26:07.000000000 +0200
43 +++ rxtx-2.2pre2/src/lfd/lockdaemon.c 2012-05-21 13:25:35.396648055 +0200
44 @@ -145,7 +145,7 @@
45 fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
46 if( fd < 0 )
47 {
48 - sprintf( message,
49 + snprintf( message, 79,
50 "RXTX fhs_lock() Error: creating lock file: %s: %s\n",
51 file, strerror(errno) );
52 syslog( LOG_INFO, message );
53 Index: rxtx-2.2pre2/src/lfd/lockdaemon.c.noinetd
54 ===================================================================
55 --- rxtx-2.2pre2.orig/src/lfd/lockdaemon.c.noinetd 2007-04-26 07:26:07.000000000 +0200
56 +++ rxtx-2.2pre2/src/lfd/lockdaemon.c.noinetd 2012-05-21 13:25:55.748647017 +0200
57 @@ -144,7 +144,7 @@
58 fd = open( file, O_CREAT | O_WRONLY | O_EXCL, 0444 );
59 if( fd < 0 )
60 {
61 - sprintf( message,
62 + snprintf( message, 79,
63 "RXTX fhs_lock() Error: creating lock file: %s: %s\n",
64 file, strerror(errno) );
65 syslog( LOG_INFO, message );