chiark / gitweb /
SECURITY: Make GETIL_B always have type `unsigned', not `int'
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 3 Dec 2016 16:52:42 +0000 (16:52 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 May 2020 19:09:56 +0000 (20:09 +0100)
commit0457b397418afbeed72d627cda199071a633aa30
treeb5381af25bef38a3596668fbde5bdc41237f1d5b
parent37792aacaf7abbcdac6a02715a5ef794b5147f13
SECURITY: Make GETIL_B always have type `unsigned', not `int'

Otherwise unwanted sign extension can easily occur when converting
from the implicit int to unsigned long, eg in GET_L.

Without this, ttls and the 32-bit SOA fields can be sign-extended,
exposing invalid values to the application.

Found by AFL 2.35b.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/internal.h