summaryrefslogtreecommitdiff
path: root/src/data.c
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-17 08:58:20 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-09-17 08:58:20 +0000
commitc3ba808aef8fcf59b04eb959e9958159648eae8a (patch)
tree398524d47808bbe1dd299f0dee99c0508c88d7af /src/data.c
parent942f06393a915ff354c57d3efae651dca2b3bc75 (diff)
Import XORG-6_8_1 to CYGWIN branchCYGWIN-6_8_1-MERGE
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';