crates/backtrace-sys2/src/libbacktrace/xztest.c in pf2-0.6.0 vs crates/backtrace-sys2/src/libbacktrace/xztest.c in pf2-0.7.0

- old
+ new

@@ -1,7 +1,7 @@ /* xztest.c -- Test for libbacktrace LZMA decoder. - Copyright (C) 2020-2021 Free Software Foundation, Inc. + Copyright (C) 2020-2024 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -170,10 +170,10 @@ fprintf (stderr, "test %s: got uncompressed length %zu, want %zu\n", tests[i].name, uncompressed_len, v); ++failures; } - else if (memcmp (tests[i].uncompressed, uncompressed, v) != 0) + else if (v > 0 && memcmp (tests[i].uncompressed, uncompressed, v) != 0) { size_t j; fprintf (stderr, "test %s: uncompressed data mismatch\n", tests[i].name);