From: Adam Dickmeiss Date: Fri, 4 Jan 2013 13:46:58 +0000 (+0100) Subject: ISO2709 decoding: be more picky WRT header X-Git-Tag: v4.2.48~8 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=5bc2ee09e4dff0f872ce738a5327bced915e3474;ds=sidebyside ISO2709 decoding: be more picky WRT header --- diff --git a/src/marc_read_iso2709.c b/src/marc_read_iso2709.c index 00fedbb..03bedd7 100644 --- a/src/marc_read_iso2709.c +++ b/src/marc_read_iso2709.c @@ -36,7 +36,11 @@ int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize) yaz_marc_reset(mt); - record_length = atoi_n (buf, 5); + if (!atoi_n_check(buf, 5, &record_length)) + { + yaz_marc_cprintf(mt, "Bad leader"); + return -1; + } if (record_length < 25) { yaz_marc_cprintf(mt, "Record length %d < 24", record_length);