#!/bin/sh
#
# CVE-2018-25018
#   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990541
#   https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9845

set -u

# Reproducer Testcase: https://oss-fuzz.com/download?testcase_id=5766983634124800
unrar-nonfree t debian/tests/data/clusterfuzz-testcase-minimized-unrar_fuzzer-5766983634124800

status=$?

set -e

# from source code file: "errhnd.hpp"
readonly RARX_CRC=3

echo "Exit status: ${status}"
if [ "${status}" != ${RARX_CRC} ]
then
    exit 1
fi

exit 0
