The following reply was made to PR kern/175648; it has been noted by GNATS.

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: kern/175648: commit references a PR
Date: Fri,  1 Mar 2013 16:18:59 +0000 (UTC)

 Author: jhb
 Date: Fri Mar  1 16:18:40 2013
 New Revision: 247553
 URL: http://svnweb.freebsd.org/changeset/base/247553
 
 Log:
   MFC 246035:
   - Compute the correct size to reallocate when doubling the size of the
     array of loaded objects to avoid a buffer overrun.
   - Use reallocf() to avoid leaking memory if the realloc() fails.
   
   PR:          kern/175648
 
 Modified:
   stable/9/lib/libproc/proc_rtld.c
 Directory Properties:
   stable/9/lib/libproc/   (props changed)
 
 Modified: stable/9/lib/libproc/proc_rtld.c
 ==============================================================================
 --- stable/9/lib/libproc/proc_rtld.c   Fri Mar  1 15:59:14 2013        
(r247552)
 +++ stable/9/lib/libproc/proc_rtld.c   Fri Mar  1 16:18:40 2013        
(r247553)
 @@ -44,7 +44,8 @@ map_iter(const rd_loadobj_t *lop, void *
  
        if (phdl->nobjs >= phdl->rdobjsz) {
                phdl->rdobjsz *= 2;
 -              phdl->rdobjs = realloc(phdl->rdobjs, phdl->rdobjsz);
 +              phdl->rdobjs = reallocf(phdl->rdobjs, sizeof(*phdl->rdobjs) *
 +                  phdl->rdobjsz);
                if (phdl->rdobjs == NULL)
                        return (-1);
        }
 _______________________________________________
 svn-src-...@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
 
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to