1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Never try to test character past given buffer

In case units[0] would be already '\0', do not check units[1].
This commit is contained in:
Zdenek Kabelac 2012-02-13 14:23:40 +00:00
parent 5e4f234918
commit 172c87f7ca
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.92 -
====================================
Properly test buffer for unit check in units_to_bytes().
Add configure --with-systemdsystemunitdir.
Add check for allocation failure in _build_matcher().
Add check for rimage name allocation failure in _raid_add_images().

View File

@ -60,7 +60,7 @@ uint64_t units_to_bytes(const char *units, char *unit_type)
v = 1;
/* Only one units char permitted. */
if (*(units + 1))
if (units[0] && units[1])
return 0;
if (v == 1)