From 03dccce903176e61f889b1558834aa5a09f9f8c0 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 16 Apr 2012 10:32:28 +0200 Subject: [PATCH] Fix reading beyond string in yaz_sort_spec Spotted by Debians buildds output: https://buildd.debian.org/fetch.cgi?pkg=yaz&arch=mips& ver=4.2.30-1&stamp=1334563202&file=log --- src/sortspec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sortspec.c b/src/sortspec.c index 990c9a4..7e0f7fc 100644 --- a/src/sortspec.c +++ b/src/sortspec.c @@ -123,7 +123,7 @@ Z_SortKeySpecList *yaz_sort_spec(ODR out, const char *arg) sks->u.missingValueData->size = sks->u.missingValueData->len; sks->u.missingValueData->buf = (unsigned char*) odr_strdup(out, sort_flags+i); - i += strlen(sort_flags+i); + i += strlen(sort_flags+i) - 1; } } } -- 1.7.10.4