From: Adam Dickmeiss Date: Wed, 2 Jun 2010 13:50:18 +0000 (+0200) Subject: Detect and throw Present Out of Range diagnostic X-Git-Tag: v1.1.5~6 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=a33667e77c497b4b3f869fdf5d0fb97896363780;p=metaproxy-moved-to-github.git Detect and throw Present Out of Range diagnostic --- diff --git a/src/filter_multi.cpp b/src/filter_multi.cpp index 61d001c..8ddc5a8 100644 --- a/src/filter_multi.cpp +++ b/src/filter_multi.cpp @@ -766,6 +766,14 @@ void yf::Multi::Frontend::present(mp::Package &package, Z_APDU *apdu_req) f_resp->records = z_records_diag; *f_resp->presentStatus = Z_PresentStatus_failure; } + else if (number < 0 || number > jobs.size()) + { + f_apdu = + odr.create_presentResponse( + apdu_req, + YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE, + 0); + } else { f_resp->records = (Z_Records *) odr_malloc(odr, sizeof(Z_Records));