summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-02-08 23:38:05 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-02-08 23:38:05 +0000
commit50c52408f5945bf9f37329011376a3165f12cbc6 (patch)
treebe6d22746de2c4b5e93e4eac53d5cb82694be60f /desktop
parent6fee220c529a960da6fe2ba96f3bfbbb40796003 (diff)
downloadnetsurf-50c52408f5945bf9f37329011376a3165f12cbc6.tar.gz
netsurf-50c52408f5945bf9f37329011376a3165f12cbc6.tar.bz2
Fix seg fault when moving cursor up onto empty top line.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/textarea.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 39135b0c1..a15d64ca2 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1836,7 +1836,7 @@ bool textarea_keypress(struct textarea *ta, uint32_t key)
c_line = ta->caret_pos.line;
c_chars = ta->caret_pos.char_off;
- if (ta->text.data[b_off + b_len - 1] == ' '
+ if (b_len > 0 && ta->text.data[b_off + b_len - 1] == ' '
&& line < ta->line_count - 1)
b_len--;