Here is the critical code:
…
path_map_iterator=MagickMapAllocateIterator(path_map); //692
if (IsEventLogging())
{
char
list_seperator[2],
*search_path=0;
list_seperator[0]=DirectoryListSeparator;
list_seperator[1]='\0';
while(MagickMapIterateNext(path_map_iterator,&key)) //702
…
MagickMapAllocateIterator(…) may return NULL,the “iterator” was passed to MagickMapIterateNext.
in MagickMapIterateNext:
…
MagickExport unsigned int
MagickMapIterateNext(MagickMapIterator iterator,const char **key)
{
assert(iterator != 0); //868
assert(iterator->signature == MagickSignature);
assert(key != 0);
…
If iterator is NULL,the assertion "assert(iterator !=0)" will failed.
Credit: ADLab of Venustech
This is a duplicate of issue #502, which is now fixed.