From 4d3356435f453bdc24ac3c6c2da74d98c981db15 Mon Sep 17 00:00:00 2001 From: Shawn Landden Date: Sun, 16 Jun 2019 13:17:33 -0500 Subject: stage1: check for null in buf_len and buf_ptr follow up for f4b8850002d5 --- src/buffer.hpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/buffer.hpp') diff --git a/src/buffer.hpp b/src/buffer.hpp index 082d584e2c..d4a911fc21 100644 --- a/src/buffer.hpp +++ b/src/buffer.hpp @@ -27,11 +27,13 @@ Buf *buf_sprintf(const char *format, ...) Buf *buf_vprintf(const char *format, va_list ap); static inline size_t buf_len(Buf *buf) { + assert(buf); assert(buf->list.length); return buf->list.length - 1; } static inline char *buf_ptr(Buf *buf) { + assert(buf); assert(buf->list.length); return buf->list.items; } -- cgit v1.2.3