Commit 29953187 authored by David Lawrence's avatar David Lawrence
Browse files

ok, this is The Last Time mucking with the dang

offset overflow check.  the expression has been simplified and if
this causes warnings on any platform now i'm gonna go postal.
parent 7685c082
......@@ -1265,16 +1265,14 @@ journal_next(dns_journal_t *j, journal_pos_t *pos) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR,
"%s: journal file corrupt: "
"expected serial %u, got %u",
j->filename,
pos->serial, xhdr.serial0);
j->filename, pos->serial, xhdr.serial0);
return (ISC_R_UNEXPECTED);
}
/*
* Check for offset wraparound.
*/
if (xhdr.size + sizeof(journal_rawxhdr_t) > ISC_OFFSET_MAXIMUM ||
ISC_OFFSET_MAXIMUM - xhdr.size - sizeof(journal_rawxhdr_t)
if ((isc_offset_t)(pos->offset + sizeof(journal_rawxhdr_t) + xhdr.size)
< pos->offset) {
isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR,
"%s: offset too large", j->filename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment