X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=util%2Fiso2709.c;h=7de97f265535cb091c631cfa2009e9393a3b56cf;hb=3f6af0f3aa9f114cf562c28f2ed0b954e4c5d659;hp=1bd46e3cae5d16bacdea92daecb22bc1a7e4eb88;hpb=3eeb964804c26b7aff33c8a383611e110a1f02ab;p=egate.git diff --git a/util/iso2709.c b/util/iso2709.c index 1bd46e3..7de97f2 100644 --- a/util/iso2709.c +++ b/util/iso2709.c @@ -3,10 +3,14 @@ Europagate, 1994-1995. - $Log: iso2709.c,v $ - Revision 1.4 1995/02/15 17:45:44 adam - Bug fix in iso2709 module. - + iso2709.c,v + * Revision 1.5 1995/02/22 15:24:14 adam + * Function iso2709_cvt makes a litte check for the format. It returns + * NULL if the buffer parameter can never be a MARC record. + * + * Revision 1.4 1995/02/15 17:45:44 adam + * Bug fix in iso2709 module. + * * Revision 1.3 1995/02/10 17:05:18 adam * New function iso2709_display to display MARC records in a * line-by-line format. The iso2709_cvt function no longer @@ -100,6 +104,11 @@ Iso2709Rec iso2709_cvt (const char *buf) p->base_address = atoin (buf+12, 4); strncpyx (p->user_systems, buf+17, 3); + if (p->record_length < 26) + { + free (p); + return NULL; + } p->length_data_entry = atoin (buf+20, 1); p->length_starting = atoin (buf+21, 1); p->length_implementation = atoin (buf+22, 1);