The function docs state that 'strcontent' may be NULL. This was added in
8b3a0b28ba2 but that commit neglected to fix rest of the function.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
if (filecontentLen > 0 &&
filecontent[filecontentLen - 1] == '\n' &&
- strcontent[strlen(strcontent) - 1] != '\n') {
- if (virAsprintf(&fixedcontent, "%s\n", strcontent) < 0)
+ cmpcontent[strlen(cmpcontent) - 1] != '\n') {
+ if (virAsprintf(&fixedcontent, "%s\n", cmpcontent) < 0)
goto failure;
cmpcontent = fixedcontent;
}