2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

[master] Corrects medium impact issues reported by Coverity.

Merges in rt36933
This commit is contained in:
Thomas Markwalder
2014-08-28 07:56:20 -04:00
parent 36e2c22493
commit a07d99bbef
13 changed files with 70 additions and 42 deletions

View File

@@ -53,7 +53,12 @@ int main (int argc, char **argv)
exit(1);
}
omapi_init ();
status = omapi_init ();
if (status != ISC_R_SUCCESS) {
fprintf(stderr, "omapi_init failed: %s\n",
isc_result_totext(status));
exit(1);
}
if (argc > 1 && !strcmp (argv [1], "listen")) {
if (argc < 3) {

View File

@@ -606,7 +606,9 @@ isc_result_t trace_get_next_packet (trace_type_t **ttp,
paylen = tpkt -> length;
if (paylen % 8)
paylen += 8 - (tpkt -> length % 8);
if (paylen > (*bufmax)) {
/* allocate a buffer if we need one or current buffer is too small */
if ((*buf == NULL) || (paylen > (*bufmax))) {
if ((*buf))
dfree ((*buf), MDL);
(*bufmax) = ((paylen + 1023) & ~1023U);
@@ -617,7 +619,7 @@ isc_result_t trace_get_next_packet (trace_type_t **ttp,
return ISC_R_NOMEMORY;
}
}
status = fread ((*buf), 1, paylen, traceinfile);
if (status < paylen) {
if (ferror (traceinfile))