From 104771e55e56474931cbb34327e42af5e8ada665 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Thu, 21 Mar 2019 09:58:56 -0700 Subject: [PATCH] zip_archive.cc: delete android_errorWriteLog The process of determining whether or not to emit a safetynet error entry while processing a malformed file relies on addition overflow. Since this is only logging, and logging which isn't used, delete the code instead of trying to fix the logic which is causing the integer overflow. This change is necessary to enable integer sanitization on this code. Somewhat related to Bug: 122975762 Test: atest ziparchive-tests Change-Id: I6b41ccf7881348cb4e5236324eaa44a05662a725 --- libziparchive/zip_archive.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libziparchive/zip_archive.cc b/libziparchive/zip_archive.cc index 6b9f6e165..0710d0add 100644 --- a/libziparchive/zip_archive.cc +++ b/libziparchive/zip_archive.cc @@ -278,11 +278,6 @@ static int32_t MapCentralDirectory0(const char* debug_file_name, ZipArchive* arc if (static_cast(eocd->cd_start_offset) + eocd->cd_size > eocd_offset) { ALOGW("Zip: bad offsets (dir %" PRIu32 ", size %" PRIu32 ", eocd %" PRId64 ")", eocd->cd_start_offset, eocd->cd_size, static_cast(eocd_offset)); -#if defined(__ANDROID__) - if (eocd->cd_start_offset + eocd->cd_size <= eocd_offset) { - android_errorWriteLog(0x534e4554, "31251826"); - } -#endif return kInvalidOffset; } if (eocd->num_records == 0) {