]> sourceware.org Git - lvm2.git/commit
Fix reading byte from char params[-1] position
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 8 Mar 2011 22:43:19 +0000 (22:43 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 8 Mar 2011 22:43:19 +0000 (22:43 +0000)
commitd9785ae4f161ad7ef1d48b4101ed9217b52255ed
tree4d5a068f2e3408a6a665905b2e60c384427edb54
parentb118538f949be7487bbe9079753c57f942c02cd9
Fix reading byte from char params[-1] position

When the ->params string is empty - memory access is made on the byte
before allocated buffer (catched by valgrind) - in the case it would
constain 0x20 - it would even overwrite this buffer.
So fix by checking len > 0 before doing such access.
Also slightly optimise this loop from repeated strlen call.
WHATS_NEW_DM
libdm/ioctl/libdm-iface.c
This page took 0.03753 seconds and 5 git commands to generate.