1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-25 13:49:28 +03:00

Test uuid for NULL

Add test for NULL before passing uuid as src argument to memcpy.
As memcpy function is declared as function not accepting NULL.
Though we pass NULL only with zero length so this patch presents
no functional change to the code.
This commit is contained in:
Zdenek Kabelac
2010-11-30 22:53:37 +00:00
parent 8865a4c19e
commit 973db2a823

View File

@ -343,7 +343,9 @@ static char *_extract_uuid_prefix(const char *uuid, const int separator)
return NULL;
}
memcpy(uuid_prefix, uuid, len);
if (uuid)
memcpy(uuid_prefix, uuid, len);
uuid_prefix[len] = '\0';
return uuid_prefix;