Skip site navigation (1)Skip section navigation (2)
Date:      Wed,  4 Oct 2000 07:03:39 -0700 (PDT)
From:      dockes@musicmaker.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/21751: libcam's cam_real_open_device() may lose fds on error condition
Message-ID:  <20001004140339.13AF637B66C@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         21751
>Category:       bin
>Synopsis:       libcam's cam_real_open_device() may lose fds on error condition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 04 07:10:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jean-Francois Dockes
>Release:        4.1.1-RELEASE
>Organization:
musicmaker.com
>Environment:
FreeBSD hautmedoc 4.1.1-RELEASE FreeBSD 4.1.1-RELEASE #1: Tue Oct  3 17:15:13 MEST 2000     dockes@hautmedoc:/u/src/sys/compile/HAUTMEDOC  i386

>Description:
In libcam's camlib.c, if one of the 2 last ioctl calls in 
cam_real_open_device() fails (probably a very unlikely condition, but 
the fix is simple enough),the routine will return an error without 
closing an open descriptor.

>How-To-Repeat:

>Fix:
*** camlib.c.org        Tue Oct  3 16:29:40 2000
--- camlib.c    Wed Oct  4 15:51:51 2000
***************
*** 555,559 ****
        char *func_name = "cam_real_open_device";
        union ccb ccb;
!       int fd, malloced_device = 0;
  
        /*
--- 555,559 ----
        char *func_name = "cam_real_open_device";
        union ccb ccb;
!       int fd = -1, malloced_device = 0;
  
        /*
***************
*** 692,695 ****
--- 692,697 ----
  crod_bailout:
http://perso.wanadoo.fr/dockes/camlib-fd.patch


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


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001004140339.13AF637B66C>