/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
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);