1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00

name.c: fix possible crash in attstore()

From OpenSUSE:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-env.dif
(the init.c fix there is already done differently in 3654ee73)

src/cmd/ksh93/sh/name.c: attstore():
- Check nv_mapchar() returns a non-null pointer before using it.
This commit is contained in:
Martijn Dekker 2021-01-28 04:01:49 +00:00
parent cc4927529b
commit 3ad4307054

View file

@ -2113,7 +2113,7 @@ static void attstore(register Namval_t *np, void *data)
if((flag&(NV_UTOL|NV_LTOU|NV_INTEGER)) == (NV_UTOL|NV_LTOU))
{
data = (void*)nv_mapchar(np,0);
if(strcmp(data,e_tolower) && strcmp(data,e_toupper))
if(data && strcmp(data,e_tolower) && strcmp(data,e_toupper))
return;
}
flag &= (NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER);