From c2fd55cbabbdca9c2110b153355850196d41319f Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 22 Nov 2009 13:31:47 +0000 Subject: Protect against NULL pointers svn path=/trunk/netsurf/; revision=9681 --- desktop/textarea.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'desktop') diff --git a/desktop/textarea.c b/desktop/textarea.c index f573e40bc..eac21699d 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -252,6 +252,9 @@ int textarea_get_text(struct text_area *ta, char *buf, unsigned int len) if (buf == NULL && len == 0) { /* want length */ return ta->text_len; + } else if (buf == NULL) { + /* Can't write to NULL */ + return -1; } if (len < ta->text_len) { -- cgit v1.2.3