aboutsummaryrefslogtreecommitdiffstats
path: root/sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'sink.c')
-rw-r--r--sink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sink.c b/sink.c
index 76cd2bb5..a3f5dea3 100644
--- a/sink.c
+++ b/sink.c
@@ -649,6 +649,9 @@ int stuffline(struct query *ctl, char *buf)
int n, oldphase;
char *last;
+ if (!buf)
+ return -1;
+
/* The line may contain NUL characters. Find the last char to use
* -- the real line termination is the sequence "\n\0".
*/