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 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 );