Merge pull request #5621 from zdohnal/cgigetarray-sigsegv