summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2013-10-19 15:32:36 +0200
committerYorhel <git@yorhel.nl>2013-10-19 15:32:36 +0200
commit775c701a3fefe00ab5da46b68e3ae857d7d5f044 (patch)
tree4f88cb4ba710ab367d876928b9aeaeaa2903c312
parent11321a6c9b6910610ae36e022152754fe06038ac (diff)
proto.c: Don't unconditionally advance 'off' in adc_parse()
'off' must either point to an empty string or the remainder of the command. Unconditionally advancing 'off' may cause adc_parse() to read beyond the given buffer.
-rw-r--r--src/proto.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/proto.c b/src/proto.c
index 11f3df6..1a0a7d7 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -245,7 +245,8 @@ gboolean adc_parse(const char *str, adc_cmd_t *c, int *feats, GError **err) {
g_set_error_literal(err, 1, 0, "Invalid characters after command.");
return FALSE;
}
- off++;
+ if(off[0])
+ off++;
// type = U, first argument is source CID. But we don't handle that here.