mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
[master] silence coverity warnings
This commit is contained in:
@@ -367,7 +367,7 @@ dns_test_getdata(const char *file, unsigned char *buf,
|
|||||||
char *rp, *wp;
|
char *rp, *wp;
|
||||||
char s[BUFSIZ];
|
char s[BUFSIZ];
|
||||||
size_t len, i;
|
size_t len, i;
|
||||||
FILE *f;
|
FILE *f = NULL;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
result = isc_stdio_open(file, "r", &f);
|
result = isc_stdio_open(file, "r", &f);
|
||||||
@@ -392,9 +392,9 @@ dns_test_getdata(const char *file, unsigned char *buf,
|
|||||||
if (len == 0U)
|
if (len == 0U)
|
||||||
continue;
|
continue;
|
||||||
if (len % 2 != 0U)
|
if (len % 2 != 0U)
|
||||||
return (ISC_R_UNEXPECTEDEND);
|
CHECK(ISC_R_UNEXPECTEDEND);
|
||||||
if (len > bufsiz * 2)
|
if (len > bufsiz * 2)
|
||||||
return (ISC_R_NOSPACE);
|
CHECK(ISC_R_NOSPACE);
|
||||||
rp = s;
|
rp = s;
|
||||||
for (i = 0; i < len; i += 2) {
|
for (i = 0; i < len; i += 2) {
|
||||||
n = fromhex(*rp++);
|
n = fromhex(*rp++);
|
||||||
@@ -404,10 +404,14 @@ dns_test_getdata(const char *file, unsigned char *buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_stdio_close(f);
|
|
||||||
|
|
||||||
*sizep = bp - buf;
|
*sizep = bp - buf;
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
result = ISC_R_SUCCESS;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if (f != NULL)
|
||||||
|
isc_stdio_close(f);
|
||||||
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user