projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d168d8
)
ISO2709 decoding: be more picky WRT header
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 4 Jan 2013 13:46:58 +0000
(14:46 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 4 Jan 2013 13:46:58 +0000
(14:46 +0100)
src/marc_read_iso2709.c
patch
|
blob
|
history
diff --git
a/src/marc_read_iso2709.c
b/src/marc_read_iso2709.c
index
00fedbb
..
03bedd7
100644
(file)
--- 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);