xml=p+offset;
entity=strchr(xml,';');
}
- (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
+ if (entity != (char *) NULL)
+ (void) CopyMagickMemory(xml+length,entity+1,strlen(entity));
(void) strncpy(xml,entities[i],length);
}
}
return;
xml[length]='\0';
xml=ParseEntities(xml,root->entities,state);
- if (*xml_info->content != '\0')
+ if ((xml_info->content != (char *) NULL) && (*xml_info->content != '\0'))
{
(void) ConcatenateString(&xml_info->content,xml);
xml=DestroyString(xml);
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
root->processing_instructions[i][j+2]=(char *) ResizeQuantumMemory(
root->processing_instructions[i][j+1],(size_t) (j+1),
- sizeof(**root->processing_instructions));
+ sizeof(*root->processing_instructions));
if (root->processing_instructions[i][j+2] == (char *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
(void) CopyMagickString(root->processing_instructions[i][j+2]+j-1,
xml_info->tag=ConstantString(tag);
else
xml_info=AddChildToXMLTree(xml_info,tag,strlen(xml_info->content));
- xml_info->attributes=attributes;
+ if (xml_info != (XMLTreeInfo *) NULL)
+ xml_info->attributes=attributes;
root->node=xml_info;
}