From ea864ff28cb9cecd0ae34de05b6f7bcffef9147e Mon Sep 17 00:00:00 2001 From: Bart Massey Date: Thu, 3 Apr 2008 15:08:02 -0700 Subject: [PATCH] Reworked patch for bug #15305 --- src/xcms/cmsColNm.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/xcms/cmsColNm.c b/src/xcms/cmsColNm.c index c48b85a..eacff2f 100644 --- a/src/xcms/cmsColNm.c +++ b/src/xcms/cmsColNm.c @@ -738,7 +738,12 @@ LoadColornameDB(void) return(XcmsFailure); } - stringSectionSize(stream, &nEntries, &size); + if (stringSectionSize(stream, &nEntries, &size) != XcmsSuccess || + nEntries == 0) { + (void) fclose(stream); + XcmsColorDbState = XcmsDbInitFailure; + return(XcmsFailure); + } rewind(stream); strings = (char *) Xmalloc(size); -- 1.5.4.4