summaryrefslogtreecommitdiff
path: root/desktop/textarea.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-11-22 13:31:47 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-11-22 13:31:47 +0000
commitc2fd55cbabbdca9c2110b153355850196d41319f (patch)
tree57db6d48aecc80ba02f19a0b2bcc518bba816b4e /desktop/textarea.c
parentd010712a9c02ea9df3c340244235911b652c5b3a (diff)
downloadnetsurf-c2fd55cbabbdca9c2110b153355850196d41319f.tar.gz
netsurf-c2fd55cbabbdca9c2110b153355850196d41319f.tar.bz2
Protect against NULL pointers
svn path=/trunk/netsurf/; revision=9681
Diffstat (limited to 'desktop/textarea.c')
-rw-r--r--desktop/textarea.c3
1 files changed, 3 insertions, 0 deletions
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) {