X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsiconv.c;h=8916561feb3255d1f85d17324683df10f71edf43;hb=19c0b332044f06ee33eaf66ca92675d9cda8d1b9;hp=1cd81ed659a29042b1549329c4a1eafe96cf38c7;hpb=60b5f5ba6f34ef79b037eb8af1e2554d9842bb10;p=yaz-moved-to-github.git diff --git a/src/siconv.c b/src/siconv.c index 1cd81ed..8916561 100644 --- a/src/siconv.c +++ b/src/siconv.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: siconv.c,v 1.33 2007-01-18 14:45:05 adam Exp $ + * $Id: siconv.c,v 1.34 2007-03-09 08:39:38 adam Exp $ */ /** * \file siconv.c @@ -394,6 +394,13 @@ static unsigned long yaz_read_marc8 (yaz_iconv_t cd, unsigned char *inp, for (cd->comb_size = 0; cd->comb_size < 8; cd->comb_size++) { int comb = 0; + if (inbytesleft == 0 && cd->comb_size) + { + cd->my_errno = YAZ_ICONV_EINVAL; + x = 0; + *no_read = 0; + break; + } x = yaz_read_marc8_comb(cd, inp, inbytesleft, no_read, &comb); if (!comb || !x) break;