[lvm-devel] [PATCH 1/2] Fix read byte from char[-1] position

Alasdair G Kergon agk at redhat.com
Fri Mar 4 20:39:47 UTC 2011


On Wed, Mar 02, 2011 at 07:09:07PM +0100, Zdenek Kabelac wrote:
> When the ->params is empty string - access is made on the byte
> before allocated buffer (catched by valgrind) - in case it would
> constains 0x20 - it would even overwrite this buffer.
> So fix by checking len > 0 before doing such access.
> Optimise the code and use len counter instead of multiple strlen calls.
 
Needing more context for this one:
  Under what conditions is the bug triggered?
  What are the implications when it is?

Alasdair




More information about the lvm-devel mailing list