[bug #68560] [PATCH] [grops] ASAN reports 1-byte heap overread with certain invalid `import` device extension command arguments

"G. Branden Robinson" <[email protected]> Sun, 26 Jul 2026 20:03:47 -0400 (EDT)
Newsgroups gmane.comp.printing.groff.bugs
Message-ID <[email protected]>
--8323329-424238335-1785110627=:2913989
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline

Update of bug #68560 (group groff):=0A=0A                  Status:         =
    In Progress =3D> Fixed=0A             Open/Closed:                    O=
pen =3D> Closed=0A=0A    __________________________________________________=
_____=0A=0AFollow-up Comment #3:=0A=0A=0Acommit 3286e0681805eca77ac7518c8cd=
ff0beb54eabb6=0AAuthor: G. Branden Robinson <[email protected]>=
=0ADate:   Fri Jul 24 15:51:10 2026 -0500=0A=0A    [grops]: Fix Savannah #6=
8560.=0A    =0A    * src/devices/grops/ps.cpp (ps_printer::do_import): Revi=
se to avoid=0A      overreading heap by one byte with certain ill-formed ar=
guments to the=0A      `import` device extension command.  Recast error dia=
gnostic to report=0A      the full contents of the invalid argument and cha=
racterize it simply=0A      as "invalid" due to non-numeric contents.  Also=
 clarify the language=0A      of these diagnostics.  The grammar of "trout"=
/"grout" is such that the=0A      device control command reads, to the end =
of the line, one big=0A      "argument" containing space-delimited paramete=
rs.=0A    =0A    Fixes <https://savannah.gnu.org/bugs/?68560>.  Thanks to B=
runo Haible=0A    for the concurrent discovery.  Problem introduced by me i=
n commit=0A    9f050b7ed7, 7 May.=0A    =0A    With this commit, for me on =
my system (GNU/Linux amd64 using GCC=0A    10.2.1), groff now builds and ru=
ns its test suite successfully with the=0A    following compiler options.=
=0A    =0A    -fsanitize=3Daddress=0A    -fsanitize-undefined-trap-on-error=
=0A    -fsanitize=3Dsigned-integer-overflow=0A    -fsanitize=3Dundefined=0A=
    =0A    However we can't employ the full power of ASAN yet.  I'm using=
=0A    `ASAN_OPTIONS=3D"detect_leaks=3D0 abort_on_error=3D1=0A    allocator=
_may_return_null=3D1 alloc_dealloc_mismatch=3D0"`.=0A    =0A    I'm informe=
d that Clang's ASAN is more sensitive.  However I'm unable to=0A    use Cla=
ng 11.0.1 to build groff in this same environment because it=0A    doesn't =
get along well with Gnulib's <stdckdint.h> implementation and=0A    our att=
empt to hew to ISO C++98; it blows up complaining that the `long=0A    long=
` data type demands C++11.=0A=0A=0A=0A=0A    ______________________________=
_________________________=0A=0AReply to this item at:=0A=0A  <https://savan=
nah.gnu.org/bugs/?68560>=0A=0A_____________________________________________=
__=0AMessage sent via Savannah=0Ahttps://savannah.gnu.org/=0A
--8323329-424238335-1785110627=:2913989
Content-Type: APPLICATION/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCamagYwAKCRCqLAuaBUf3
TlweAP0cTscxzYCI56Hbnr+gwzP8mW5jtDHYK861/qoAJhlBNAD/Tg9B9rkHB/Pr
1mWj76YwEaf89d+kFwWQNxpZxRA5KAk=
=UyW5
-----END PGP SIGNATURE-----

--8323329-424238335-1785110627=:2913989--