diff -r dd50d75d88e6 -r 30e88a671e72 jdk/src/share/classes/sun/security/tools/JarSigner.java --- a/jdk/src/share/classes/sun/security/tools/JarSigner.java Wed Jun 17 15:26:58 2009 +0800 +++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java Thu Jun 18 11:12:13 2009 +0800 @@ -1402,9 +1402,14 @@ } /** - * Find the position of \r\n\r\n inside bs + * Find the position of an empty line inside bs */ private int findHeaderEnd(byte[] bs) { + // An empty line can be at the beginning... + if (bs.length > 1 && bs[0] == '\r' && bs[1] == '\n') { + return 0; + } + // ... or after another line for (int i=0; i