[med-svn] r18249 - in trunk/packages/biosquid/trunk/debian: . patches

Andreas Tille tille at moszumanska.debian.org
Thu Oct 9 13:38:07 UTC 2014


Author: tille
Date: 2014-10-09 13:38:06 +0000 (Thu, 09 Oct 2014)
New Revision: 18249

Added:
   trunk/packages/biosquid/trunk/debian/patches/getopt-segmentation-fault.patch
Modified:
   trunk/packages/biosquid/trunk/debian/changelog
   trunk/packages/biosquid/trunk/debian/patches/series
Log:
Fix segmentation fault with ambiguous arguments


Modified: trunk/packages/biosquid/trunk/debian/changelog
===================================================================
--- trunk/packages/biosquid/trunk/debian/changelog	2014-10-07 19:45:51 UTC (rev 18248)
+++ trunk/packages/biosquid/trunk/debian/changelog	2014-10-09 13:38:06 UTC (rev 18249)
@@ -1,3 +1,11 @@
+biosquid (1.9g+cvs20050121-4) UNRELEASED; urgency=medium
+
+  * Fix segmentation fault with ambiguous arguments (thanks for the patch
+    to artin Steghöfer <martin at steghoefer.eu>)
+    Closes: #716353
+
+ -- Andreas Tille <tille at debian.org>  Thu, 09 Oct 2014 15:35:25 +0200
+
 biosquid (1.9g+cvs20050121-3) unstable; urgency=low
 
   * debian/control:

Added: trunk/packages/biosquid/trunk/debian/patches/getopt-segmentation-fault.patch
===================================================================
--- trunk/packages/biosquid/trunk/debian/patches/getopt-segmentation-fault.patch	                        (rev 0)
+++ trunk/packages/biosquid/trunk/debian/patches/getopt-segmentation-fault.patch	2014-10-09 13:38:06 UTC (rev 18249)
@@ -0,0 +1,23 @@
+Description: Fix segmentation fault with ambiguous arguments
+ The command line parser accessed invalid memory when a given
+ option matched several option definitions as a prefix, but none
+ of them exactly (e.g. "--s" as option with "--sam" and
+ "--samfrac" as option definitions). This was due to an incorrect
+ check of exact matching that tried to access "opt[i].name" with
+ i being greater than the upper bound of the array "opt" in case
+ of not having an exact match. Replaced it with the proper check.
+Author: Martin Steghöfer <martin at steghoefer.eu>
+Bug-Debian: http://bugs.debian.org/716353
+
+--- a/getopt.c
++++ b/getopt.c
+@@ -109,7 +109,8 @@
+ 	    opti = i;
+ 	    if (arglen == strlen(opt[i].name)) break; /* exact match, stop now */
+ 	  }
+-      if (nmatch > 1 && arglen != strlen(opt[i].name)) 
++      if (nmatch > 1 // got several prefix matches
++	    && i == nopts) // with none of them being an exact match
+ 	Die("Option \"%s\" is ambiguous; please be more specific.\n%s",
+ 	    argv[optind], usage);
+       if (nmatch == 0)

Modified: trunk/packages/biosquid/trunk/debian/patches/series
===================================================================
--- trunk/packages/biosquid/trunk/debian/patches/series	2014-10-07 19:45:51 UTC (rev 18248)
+++ trunk/packages/biosquid/trunk/debian/patches/series	2014-10-09 13:38:06 UTC (rev 18249)
@@ -7,3 +7,4 @@
 shuffle.man.patch
 sindex.man.patch
 sreformat.man.patch
+getopt-segmentation-fault.patch




More information about the debian-med-commit mailing list