summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2004-09-21 17:57:35 +0000
committerEgbert Eich <eich@suse.de>2004-09-21 17:57:35 +0000
commita983dafac59dcb425666a5a5556da4734e50c6c5 (patch)
tree6fbd73d497da68397e83ee8d27790965f80ca26a /src/data.c
parent2773a7214e282f6f673483f5233b880505947c3f (diff)
Merged over libXpm security fix provided by Chris Evans, Matthieu Herrb and
Alan Coopersmith from release 6.8.1. Fail during initialization with error if font/fontset is not set for widget. This prevents a sig11 later when the non-existent font/fontset structs are referenced. Check if xf86Info.kbdProc pointer is really set before calling it on abort as this pointer won't be set if the new modular keyboard driver is used (Matthias Hopf). Added new libs to the bindist control files. Removed inclusion of unnecessary kernel header on Linux. This may fail in an -ansi environment.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index 8f4dc69..ccd98ed 100644
--- a/src/data.c
+++ b/src/data.c
@@ -375,7 +375,7 @@ xpmGetCmt(data, cmt)
{
if (!data->type)
*cmt = NULL;
- else if (data->CommentLength) {
+ else if (data->CommentLength != 0 && data->CommentLength < SIZE_MAX - 1) {
*cmt = (char *) XpmMalloc(data->CommentLength + 1);
strncpy(*cmt, data->Comment, data->CommentLength);
(*cmt)[data->CommentLength] = '\0';