ports/107468: [ports] [dvdbackup] [patch] floating point division by zero exception when reading some DVDs

Jonathan Liu Net147 at hotmail.com
Wed Jan 3 13:30:14 UTC 2007


>Number:         107468
>Category:       ports
>Synopsis:       [ports] [dvdbackup] [patch] floating point division by zero exception when reading some DVDs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 03 13:30:13 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Liu
>Release:        6.2-RC1
>Organization:
>Environment:
FreeBSD freebsd 6.2-RC1 FreeBSD 6.2-RC1 #0: Thu Nov 16 05:12:08 UTC 2006     root at opus.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386
>Description:
When reading information from DVDs using dvdbackup, the CheckSizeArray() function may give a floating point division by zero exception as a result of failing to check if the divisor is non-zero before diving by the divisor.
>How-To-Repeat:
dvdbackup -i /dev/acd0 -I
 where /dev/acd0 is the DVD device

Note: This only occurs on some DVDs.
>Fix:
--- patch-src::dvdbackup.c.orig	Thu Jan  4 00:02:03 2007
+++ patch-src::dvdbackup.c	Thu Jan  4 00:02:17 2007
@@ -19,6 +19,16 @@
  	fprintf(stderr,"\t-a is option to the -F switch and has no effect on other options\n");
  	fprintf(stderr,"\t-s and -e should prefereibly be used together with -t \n\n");
  	exit(1);
+@@ -228,7 +228,8 @@
+ }
+ 
+ int CheckSizeArray(const int size_array[], int reference, int target) {
+-	if ( (size_array[reference]/size_array[target] == 1) &&
++	if ( size_array[target] &&
++	     (size_array[reference]/size_array[target] == 1) &&
+ 	     ((size_array[reference] * 2 - size_array[target])/ size_array[target] == 1) &&
+ 	     ((size_array[reference]%size_array[target] * 3) < size_array[reference]) ) {
+ 		/* We have a dual DVD with two feature films - now lets see if they have the same amount of chapters*/
 @@ -782,7 +783,7 @@
  	 to consider the second one a feature title we are doing two checks (biggest  + biggest - second) /second == 1
  	 and biggest%second * 3 < biggest */

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list