msxml3/tests: Protect from invalid array access (Coverity).

This commit is contained in:
Nikolay Sivov 2014-04-07 09:24:19 +04:00 committed by Alexandre Julliard
parent 071245475d
commit 6ed7d9dd1c
1 changed files with 14 additions and 4 deletions

View File

@ -1515,8 +1515,13 @@ static HRESULT WINAPI isaxattributes_getQName(
ok(index >= 0 && index <= 2, "invalid index received %d\n", index);
*QName = attrqnamesW[index];
*QNameLength = attrqnamelen[index];
if (index >= 0 && index <= 2) {
*QName = attrqnamesW[index];
*QNameLength = attrqnamelen[index];
} else {
*QName = NULL;
*QNameLength = 0;
}
return S_OK;
}
@ -1601,8 +1606,13 @@ static HRESULT WINAPI isaxattributes_getValue(ISAXAttributes* iface, int index,
ok(index >= 0 && index <= 2, "invalid index received %d\n", index);
*value = attrvaluesW[index];
*nValue = attrvalueslen[index];
if (index >= 0 && index <= 2) {
*value = attrvaluesW[index];
*nValue = attrvalueslen[index];
} else {
*value = NULL;
*nValue = 0;
}
return S_OK;
}