Fix Coverity bug 603941: Negative array index read
Signed-off-by: Philippe Saint-Pierre <[email protected]>
This commit is contained in:
committed by
Philippe Saint-Pierre
parent
37b6c4337c
commit
d32cb23734
@@ -135,8 +135,8 @@ again:
|
|||||||
if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
|
if (n > 0 && (statp->_flags & RES_F_EDNS0ERR) == 0 &&
|
||||||
(statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) {
|
(statp->options & (RES_USE_EDNS0|RES_USE_DNSSEC|RES_NSID))) {
|
||||||
n = res_nopt(statp, n, buf, sizeof(buf), anslen);
|
n = res_nopt(statp, n, buf, sizeof(buf), anslen);
|
||||||
rdata = &buf[n];
|
|
||||||
if (n > 0 && (statp->options & RES_NSID) != 0U) {
|
if (n > 0 && (statp->options & RES_NSID) != 0U) {
|
||||||
|
rdata = &buf[n];
|
||||||
n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata,
|
n = res_nopt_rdata(statp, n, buf, sizeof(buf), rdata,
|
||||||
NS_OPT_NSID, 0, NULL);
|
NS_OPT_NSID, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user