From: Adam Dickmeiss Date: Thu, 3 Dec 2009 08:35:03 +0000 (+0100) Subject: GFS: Avoid piggyback for hits < 0 from backend X-Git-Tag: v4.0.0~92^2~4 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=0c5aa5100f29ca832bf6428d8ec92618a0fc027f;p=yaz-moved-to-github.git GFS: Avoid piggyback for hits < 0 from backend If a backend returns negative hit count, then avoid comparisons against smallSetUpperBound and largeSetLowerBound. Otherwise a negative size in call to odr_malloc will occur. --- diff --git a/src/seshigh.c b/src/seshigh.c index b0349e7..bdfb499 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2755,7 +2755,9 @@ static Z_APDU *response_searchRequest(association *assoc, request *reqb, comp.which = Z_RecordComp_simple; /* how many records does the user agent want, then? */ - if (bsrt->hits <= *req->smallSetUpperBound) + if (bsrt->hits < 0) + *toget = 0; + else if (bsrt->hits <= *req->smallSetUpperBound) { *toget = bsrt->hits; if ((comp.u.simple = req->smallSetElementSetNames))