From fad57db43de8fd58c3fb4ca78f26a14e888dba4e Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Mon, 28 Nov 2011 17:38:29 +0000 Subject: [PATCH] Demote the HPSF CodePageString null check from an exception to a Warning, as we seem to be hitting it incorrectly (see bug #52258 for details) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1207477 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hpsf/CodePageString.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/poi/hpsf/CodePageString.java b/src/java/org/apache/poi/hpsf/CodePageString.java index 110961ba67..a454d6a319 100644 --- a/src/java/org/apache/poi/hpsf/CodePageString.java +++ b/src/java/org/apache/poi/hpsf/CodePageString.java @@ -158,10 +158,16 @@ class CodePageString offset += LittleEndian.INT_SIZE; _value = LittleEndian.getByteArray( data, offset, size ); - if ( _value[size - 1] != 0 ) - throw new IllegalPropertySetDataException( - "CodePageString started at offset #" + offset - + " is not NULL-terminated" ); + if ( _value[size - 1] != 0 ) { + // TODO Some files, such as TestVisioWithCodepage.vsd, are currently + // triggering this for values that don't look like codepages + // See Bug #52258 for details + logger.log(POILogger.WARN, "CodePageString started at offset #" + offset + + " is not NULL-terminated" ); +// throw new IllegalPropertySetDataException( +// "CodePageString started at offset #" + offset +// + " is not NULL-terminated" ); + } } CodePageString( String string, int codepage )