From nobody@FreeBSD.org  Wed Jan  3 13:24:38 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 6FC7616A5D8
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  3 Jan 2007 13:24:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 5FFBF13C4A5
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  3 Jan 2007 13:24:38 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l03DOcdZ079711
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 3 Jan 2007 13:24:38 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l03DOb9q079710;
	Wed, 3 Jan 2007 13:24:37 GMT
	(envelope-from nobody)
Message-Id: <200701031324.l03DOb9q079710@www.freebsd.org>
Date: Wed, 3 Jan 2007 13:24:37 GMT
From: Jonathan Liu<Net147@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [ports] [dvdbackup] [patch] floating point division by zero exception when reading some DVDs
X-Send-Pr-Version: www-3.0

>Number:         107468
>Category:       ports
>Synopsis:       dvdbackup: [patch] floating point division by zero exception when reading some DVDs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 03 13:30:13 GMT 2007
>Closed-Date:    Mon Jan 22 20:54:30 GMT 2007
>Last-Modified:  Mon Jan 22 21:00:40 GMT 2007
>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@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:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Wed Jan 3 21:15:19 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

http://www.freebsd.org/cgi/query-pr.cgi?pr=107468 
State-Changed-From-To: feedback->closed 
State-Changed-By: sat 
State-Changed-When: Mon Jan 22 20:54:19 UTC 2007 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=107468 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/107468: commit references a PR
Date: Mon, 22 Jan 2007 20:54:16 +0000 (UTC)

 sat         2007-01-22 20:54:11 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/dvdbackup   Makefile 
     sysutils/dvdbackup/files patch-src::dvdbackup.c 
   Log:
   - Prevent a division by zero [1]
   - Use gentoo mirrors
   - Bump portrevision
   
   PR:             ports/107468 [1]
   Submitted by:   Jonathan Liu <Net147@hotmail.com>
   Approved by:    Conrad J. Sabatier <conrads at cox.net> (maintainer timeout, 19 days)
   
   Revision  Changes    Path
   1.7       +2 -2      ports/sysutils/dvdbackup/Makefile
   1.3       +10 -0     ports/sysutils/dvdbackup/files/patch-src::dvdbackup.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
