lpr(1): small bounds check with reallocarray(3).
authorpfg <pfg@FreeBSD.org>
Tue, 7 Mar 2017 19:30:22 +0000 (19:30 +0000)
committerpfg <pfg@FreeBSD.org>
Tue, 7 Mar 2017 19:30:22 +0000 (19:30 +0000)
commit5e33dc7a277b337e4b50abf939172841a5c099f9
treea9ea02e5629192d2072dc674d14b6a0dd13ec7b3
parent08e629b875bb571c26c1d6417bf20ac7a5f752fa
lpr(1): small bounds check with reallocarray(3).

While here plug a memory leak upon error and postpose a multiplication
until after reallocation has succeded.

Hinted partially by: OpenBSD
Reviewed by: gad
MFC after: 2 weeks
usr.sbin/lpr/common_source/common.c