Update: Fix JVM crash and i2p.jar corruption when updating from -1

This commit is contained in:
zzz
2016-12-22 14:13:39 +00:00
parent 63a2a6da08
commit dd400bb14b
3 changed files with 30 additions and 2 deletions

View File

@ -98,6 +98,9 @@ public class FileUtil {
}
/**
* Warning - do not call any new classes from here, or
* update will crash the JVM.
*
* @param logLevel Log.WARN, etc.
* @return true if it was copied successfully
* @since 0.9.7
@ -106,6 +109,7 @@ public class FileUtil {
int files = 0;
ZipFile zip = null;
try {
final byte buf[] = new byte[8192];
zip = new ZipFile(zipfile);
Enumeration<? extends ZipEntry> entries = zip.entries();
while (entries.hasMoreElements()) {
@ -153,7 +157,13 @@ public class FileUtil {
System.err.println("INFO: File [" + entry.getName() + "] extracted and unpacked");
} else {
fos = new FileOutputStream(target);
DataHelper.copy(in, fos);
// We do NOT use DataHelper.copy() because it loads new classes
// and causes the update to crash.
//DataHelper.copy(in, fos);
int read;
while ((read = in.read(buf)) != -1) {
fos.write(buf, 0, read);
}
if (logLevel <= Log.INFO)
System.err.println("INFO: File [" + entry.getName() + "] extracted");
}

View File

@ -1,3 +1,21 @@
2016-12-22 zzz
* Blocklist:
- More efficiently check blocklist when receiving new RI
- Check blocklist when loading RIs
- Ensure blocklist is initialized before netdb
* Console: Limit age of news entries displayed
* Update: Fix JVM crash and i2p.jar corruption when updating from -1
2016-12-21 zzz
* NTP:
- Verify source address and port
- Add to command line
- Add KoD support (ticket #1896)
- Add initial IPv6 support (ticket #1897)
2016-12-20 zzz
* Build: Fix installer compile failure
2016-12-16 zzz
* Router: Synchronize graceful exit code access
* Update: Save blocklist version in UpdateManager

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 1;
public final static long BUILD = 2;
/** for example "-test" */
public final static String EXTRA = "";