[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: isomd5sum-1.0.12 bug report



On Tue, Jan 28, 2014 at 04:15:53PM -0800, Brian C. Lane wrote:
> On Sat, Jan 18, 2014 at 11:28:54AM +0000, David Binderman wrote:
> > Hello there,
> > 
> > I just ran the static analysis tool cppcheck over
> > the source code of isomd5sum-1.0.12
> > 
> > It said many things, including
> > 
> > 1.
> > 
> > [libcheckisomd5.c:106] -> [libcheckisomd5.c:106]: (warning) Array 'buf2[512]' accessed at index 512, which is out of bounds.
> > 
> > Source code is
> > 
> >             for (p=tmpbuf; buf2[loc] != ';' && loc < 512; p++, loc++)
> > 
> > I suspect 
> > 
> >             for (p=tmpbuf; loc < 512 && buf2[loc] != ';' ; p++, loc++)
> > 
> > might be better code.
> > 
> > 2.
> > 
> > [libcheckisomd5.c:144] -> [libcheckisomd5.c:144]: (warning) Array 'buf2[512]' accessed at index 512, which is out of bounds. 
> > 
> > Duplicate.
> 
> Thanks, that looks like a good fix. How did you get cppcheck to complain
> about it? I ran cppcheck --enable=all . in the isomd5sum git repo and it
> just complains about a few style issues.

Nevermind, -v adds a bunch of detail to the output.


-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]