- Addressed Coverity issues reported as of 07-31-2014:
[ISC-Bugs #36712] Corrects Coverity reported "high" impact issues
+ [ISC-Bugs #36933] Corrects Coverity reported "medium" impact issues
Changes since 4.1-ESV-R10rc1
* of the last format type and we add 1 to
* cover the entire first record.
*/
+
+ /* If format string had no valid entries prior to
+ * 'a' hunkinc will be 0. Ex: "a", "oa", "aA" */
+ if (hunkinc == 0) {
+ log_error ("%s: invalid 'a' format: %s",
+ option->name, option->format);
+ return ("<error>");
+ }
+
numhunk = ((len - hunksize) / hunkinc) + 1;
len_used = hunksize + ((numhunk - 1) * hunkinc);
} else {
* It is an 'A' type array - we repeat the
* entire record
*/
+
+ /* If format string had no valid entries prior to
+ * 'A' hunksize will be 0. Ex: "A", "oA", "foA" */
+ if (hunksize == 0) {
+ log_error ("%s: invalid 'A' format: %s",
+ option->name, option->format);
+ return ("<error>");
+ }
+
numhunk = len / hunksize;
len_used = numhunk * hunksize;
}
tmp = (struct expression *)0;
rhs = (struct expression *)0;
- /* Recursions don't return until we have parsed the end of the
- expression, so if we recursed earlier, we can now return what
- we got. */
- if (next_op == expr_none) {
- *expr = lhs;
- return 1;
- }
-
binop = next_op;
goto new_rhs;
}
/* this function will extract the secret of HMAC into a buffer */
if(key == NULL)
return (0);
- if(key->dk_func != NULL && key->dk_func != NULL) {
+ if(key->dk_func != NULL && key->dk_func->to_dns_key != NULL) {
len = key->dk_func->to_dns_key(key, out_buff, buf_len);
if (len < 0)
return (0);
if (i > 0)
work->filled += i;
}
- else if (i > 0)
- my_digest(work, buf, (unsigned)i);
+
my_digest(work, (const u_char *)name, strlen(name));
return (no + strlen(name));
}
omapi_object_t *connection = (omapi_object_t*)0;
isc_result_t status;
- 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) {
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);
return ISC_R_NOMEMORY;
}
}
-
+
status = fread ((*buf), 1, paylen, traceinfile);
if (status < paylen) {
if (ferror (traceinfile))
fail:
lease_file_is_corrupt = db_validity;
fdfail:
- unlink (newfname);
+ (void)unlink (newfname);
return 0;
}
goto out;
}
- buffer_allocate (&ddns_fwd_name.buffer,
+ if (buffer_allocate (&ddns_fwd_name.buffer,
ddns_hostname.len + ddns_domainname.len + 2,
- MDL);
- if (ddns_fwd_name.buffer) {
+ MDL)) {
ddns_fwd_name.data = ddns_fwd_name.buffer -> data;
data_string_append (&ddns_fwd_name, &ddns_hostname);
ddns_fwd_name.buffer -> data [ddns_fwd_name.len] = '.';
}
if (s1) {
- buffer_allocate(&ddns_rev_name.buffer, rev_name_len, MDL);
- if (ddns_rev_name.buffer != NULL) {
+ if (buffer_allocate(&ddns_rev_name.buffer,
+ rev_name_len, MDL)) {
ddns_rev_name.data = ddns_rev_name.buffer->data;
if (addr.len == 4) {
if (alpha->hard_lifetime_end_time <
beta->hard_lifetime_end_time)
return alpha;
+ else
+ return beta;
default:
log_fatal("Impossible condition at %s:%d.", MDL);
if (alpha->hard_lifetime_end_time <
beta->hard_lifetime_end_time)
return alpha;
+ else
+ return beta;
default:
log_fatal("Impossible condition at %s:%d.", MDL);
/* FT_DDNS* are special - one or two bytes of status
followed by the client FQDN. */
- if (ft_options [option_code].type == FT_DDNS1 ||
+
+ /* Note: FT_DDNS* option support appears to be incomplete.
+ ISC-Bugs #36996 has been opened to address this. */
+ if (ft_options [option_code].type == FT_DDNS ||
ft_options [option_code].type == FT_DDNS1) {
ddns_fqdn_t *ddns =
((ddns_fqdn_t *)
switch (new_state) {
case recover_done:
log_error("Both servers have entered recover-done!");
+ /* Fall through and tranistion to normal anyway */
+
case normal:
dhcp_failover_set_state (state, normal);
break;