Merge pull request #590 from mthorpe7/fix_upstream_crash

Fix NULL pointer issue with Word2000 empty attributes.
This commit is contained in:
Jim Derry 2017-08-28 14:25:35 -04:00 committed by GitHub
commit 1f3cf24e82

View file

@ -126,6 +126,13 @@ int TY_(tmbstrcasecmp)( ctmbstr s1, ctmbstr s2 )
int TY_(tmbstrncmp)( ctmbstr s1, ctmbstr s2, uint n )
{
if (s1 == NULL || s2 == NULL)
{
if (s1 == s2)
return 0;
return (s1 == NULL ? -1 : 1);
}
uint c;
while ((c = (byte)*s1) == (byte)*s2)