]> 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)
commite134ce7c3c31442de9a84492c7dca8e28cc3babe
tree4d5a068f2e3408a6a665905b2e60c384427edb54
parent5a47eb762a4288ff7f7a9244b882f7fd96c69e0d
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.029845 seconds and 5 git commands to generate.