From fa07767115f849081a58c5ae686a000450444f06 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Sun, 7 Jul 2019 18:06:29 +0200 Subject: [PATCH] tytest: fix runtime error: null pointer passed as argument 2, which is declared to never be null --- src/bin/tytest.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/tytest.c b/src/bin/tytest.c index 88f14785..7600abe6 100644 --- a/src/bin/tytest.c +++ b/src/bin/tytest.c @@ -139,8 +139,11 @@ _tytest_checksum(Termpty *ty) MD5Update(&ctx, (unsigned char const*)_cursor_shape, strlen(_cursor_shape)); /* Write buffer */ - MD5Update(&ctx, (unsigned char const*)ty->write_buffer.buf, - ty->write_buffer.len); + if (ty->write_buffer.buf) + { + MD5Update(&ctx, (unsigned char const*)ty->write_buffer.buf, + ty->write_buffer.len); + } MD5Final(hash, &ctx);