summaryrefslogtreecommitdiffstats
path: root/src/utils/libsmartcols/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/libsmartcols/src/buffer.c')
-rw-r--r--src/utils/libsmartcols/src/buffer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/libsmartcols/src/buffer.c b/src/utils/libsmartcols/src/buffer.c
index d376e8f..8a31379 100644
--- a/src/utils/libsmartcols/src/buffer.c
+++ b/src/utils/libsmartcols/src/buffer.c
@@ -56,6 +56,8 @@ int buffer_append_data(struct libscols_buffer *buf, const char *str)
return -EINVAL;
if (!str || !*str)
return 0;
+ if (!buf->cur || !buf->begin)
+ return -EINVAL;
sz = strlen(str);
maxsz = buf->bufsz - (buf->cur - buf->begin);