msxml3/tests: Protect from invalid array access (Coverity).
This commit is contained in:
parent
071245475d
commit
6ed7d9dd1c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue