X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fber_null.c;h=3b84a1dbd3a3808857f26d6de17dd704900b513c;hb=29a22396d7d7b1219f5b83c35983c8fb1cd79e8f;hp=bd334c924b5134c95c6924be1df206140d9a3e01;hpb=569f86b4615c2731727be2a0ff898d36f9725819;p=yaz-moved-to-github.git diff --git a/odr/ber_null.c b/odr/ber_null.c index bd334c9..3b84a1d 100644 --- a/odr/ber_null.c +++ b/odr/ber_null.c @@ -1,9 +1,9 @@ /* - * Copyright (c) 1995-2002, Index Data + * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Id: ber_null.c,v 1.12 2002-07-25 12:51:08 adam Exp $ + * $Id: ber_null.c,v 1.14 2003-03-11 11:03:31 adam Exp $ */ #if HAVE_CONFIG_H #include @@ -26,9 +26,14 @@ int ber_null(ODR o) #endif return 1; case ODR_DECODE: + if (odr_max(o) < 1) + { + odr_seterror(o, OPROTO, 39); + return 0; + } if (*(o->bp++) != 0X00) { - o->error = OPROTO; + odr_seterror(o, OPROTO, 12); return 0; } #ifdef ODR_DEBUG @@ -36,6 +41,6 @@ int ber_null(ODR o) #endif return 1; case ODR_PRINT: return 1; - default: o->error = OOTHER; return 0; + default: odr_seterror(o, OOTHER, 13); return 0; } }