URL:
<https://savannah.gnu.org/bugs/?55257>
Summary: xtotroff.c: Defined size of the array "encoding" is
too short
Project: GNU troff
Submitted by: bjarniig
Submitted on: Thu 20 Dec 2018 08:54:01 PM UTC
Category: None
Severity: 3 - Normal
Item Group: Build/Installation
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
From: Bjarni Ingi Gislason <[email protected]>
Date: Thu, 20 Dec 2018 20:47:07 +0000
Subject: xtotroff.c: Defined size of the array "encoding" is too short
The X11 part of the groff software is only compiled if the needed
libraries are found, see README.
Possible warnings from the compiler:
../src/utils/xtotroff/xtotroff.c: In function 'MapFont':
../src/utils/xtotroff/xtotroff.c:159:25: warning: '%s' directive writing
up to 255 bytes into a region of size between 0 and 255
[-Wformat-overflow=]
sprintf(encoding, "%s-%s", parsed.CharSetRegistry,
^~
parsed.CharSetEncoding);
~~~~~~~~~~~~~~~~~~~~~~
../src/utils/xtotroff/xtotroff.c:159:3: note: 'sprintf' output between 2
and 512 bytes into a destination of size 256
sprintf(encoding, "%s-%s", parsed.CharSetRegistry,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parsed.CharSetEncoding);
~~~~~~~~~~~~~~~~~~~~~~~
The size of "encoding" needs thus to be the sizeof(CharSetRegistry) +
sizeof(CharSetEncoding) + 1 (+1 for the terminating null byte?), which
sizes are defined in "src/include/XFontName.h".
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55257>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
_______________________________________________
bug-groff mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-groff