mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
[master] Corrects medium impact issues reported by Coverity.
Merges in rt36933
This commit is contained in:
@@ -1849,6 +1849,15 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
* 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 {
|
||||
@@ -1856,6 +1865,15 @@ const char *pretty_print_option (option, data, len, emit_commas, emit_quotes)
|
||||
* 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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user