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:
@@ -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) {
|
||||
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user