tytest: fix runtime error: null pointer passed as argument 2, which is declared to never be null

This commit is contained in:
Boris Faure 2019-07-07 18:06:29 +02:00
parent 58df5715d1
commit fa07767115
1 changed files with 5 additions and 2 deletions

View File

@ -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);