Skip to content

Commit

Permalink
Merge pull request #21060 from wordpress-mobile/issue/21040-android14…
Browse files Browse the repository at this point in the history
…-zip-traversal

Catch ZipException when inflating
  • Loading branch information
nbradbury authored Jul 16, 2024
2 parents 216fc90 + 8d89a13 commit ba705b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WordPress/src/main/java/org/wordpress/android/models/Note.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import java.util.Date
import java.util.EnumSet
import java.util.zip.DataFormatException
import java.util.zip.Inflater
import java.util.zip.ZipException

class Note {
val id: String
Expand Down Expand Up @@ -417,6 +418,9 @@ class Note {
} catch (e: DataFormatException) {
AppLog.e(AppLog.T.NOTIFS, "Can't decompress the PN BlockListPayload. It could be > 4K", e)
0
} catch (e: ZipException) {
AppLog.e(AppLog.T.NOTIFS, "Can't decompress the PN BlockListPayload.", e)
0
}
val out: String? = try {
String(result, 0, resultLength, charset("UTF8"))
Expand Down

0 comments on commit ba705b7

Please sign in to comment.