Lines 23-28
Link Here
|
23 |
import java.io.*; |
23 |
import java.io.*; |
24 |
import org.apache.poi.poifs.filesystem.*; |
24 |
import org.apache.poi.poifs.filesystem.*; |
25 |
import org.apache.poi.util.LittleEndian; |
25 |
import org.apache.poi.util.LittleEndian; |
|
|
26 |
import org.apache.poi.util.POILogFactory; |
27 |
import org.apache.poi.util.POILogger; |
26 |
import org.apache.poi.util.StringUtil; |
28 |
import org.apache.poi.util.StringUtil; |
27 |
import org.apache.poi.hslf.exceptions.CorruptPowerPointFileException; |
29 |
import org.apache.poi.hslf.exceptions.CorruptPowerPointFileException; |
28 |
import org.apache.poi.hslf.exceptions.EncryptedPowerPointFileException; |
30 |
import org.apache.poi.hslf.exceptions.EncryptedPowerPointFileException; |
Lines 39-44
Link Here
|
39 |
|
41 |
|
40 |
public class CurrentUserAtom |
42 |
public class CurrentUserAtom |
41 |
{ |
43 |
{ |
|
|
44 |
private static POILogger logger = POILogFactory.getLogger(CurrentUserAtom.class); |
45 |
|
42 |
/** Standard Atom header */ |
46 |
/** Standard Atom header */ |
43 |
public static final byte[] atomHeader = new byte[] { 0, 0, -10, 15 }; |
47 |
public static final byte[] atomHeader = new byte[] { 0, 0, -10, 15 }; |
44 |
/** The PowerPoint magic number for a non-encrypted file */ |
48 |
/** The PowerPoint magic number for a non-encrypted file */ |
Lines 128-134
Link Here
|
128 |
if(_contents.length >= 4) { |
132 |
if(_contents.length >= 4) { |
129 |
// PPT95 has 4 byte size, then data |
133 |
// PPT95 has 4 byte size, then data |
130 |
int size = LittleEndian.getInt(_contents); |
134 |
int size = LittleEndian.getInt(_contents); |
131 |
System.err.println(size); |
135 |
//System.err.println(size); |
132 |
if(size + 4 == _contents.length) { |
136 |
if(size + 4 == _contents.length) { |
133 |
throw new OldPowerPointFormatException("Based on the Current User stream, you seem to have supplied a PowerPoint95 file, which isn't supported"); |
137 |
throw new OldPowerPointFormatException("Based on the Current User stream, you seem to have supplied a PowerPoint95 file, which isn't supported"); |
134 |
} |
138 |
} |
Lines 173-179
Link Here
|
173 |
long usernameLen = LittleEndian.getUShort(_contents,20); |
177 |
long usernameLen = LittleEndian.getUShort(_contents,20); |
174 |
if(usernameLen > 512) { |
178 |
if(usernameLen > 512) { |
175 |
// Handle the case of it being garbage |
179 |
// Handle the case of it being garbage |
176 |
System.err.println("Warning - invalid username length " + usernameLen + " found, treating as if there was no username set"); |
180 |
logger.log(POILogger.WARN, "Warning - invalid username length " + usernameLen + " found, treating as if there was no username set"); |
177 |
usernameLen = 0; |
181 |
usernameLen = 0; |
178 |
} |
182 |
} |
179 |
|
183 |
|