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:
@ -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;
|
||||
|
Reference in New Issue
Block a user