X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=odr%2Fber_tag.c;h=a0e39bbdc072a53ccd87223f2374b1dc23c43586;hp=fb16296b82c9757d654eceb698b541579e2f28e2;hb=c3a132ce4aea3bb358b185ef58781b4bef8745fc;hpb=41f4b2c49b60cf5f9ae896b537211ae830c39a55 diff --git a/odr/ber_tag.c b/odr/ber_tag.c index fb16296..a0e39bb 100644 --- a/odr/ber_tag.c +++ b/odr/ber_tag.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: ber_tag.c,v $ - * Revision 1.7 1995-03-08 12:12:13 quinn + * Revision 1.9 1995-03-15 08:37:18 quinn + * Fixed protocol bugs. + * + * Revision 1.8 1995/03/10 11:44:40 quinn + * Fixed serious stack-bug in odr_cons_begin + * + * Revision 1.7 1995/03/08 12:12:13 quinn * Added better error checking. * * Revision 1.6 1995/02/14 11:54:33 quinn @@ -54,6 +60,8 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) { o->bp = o->buf; lclass = -1; + if (o->direction == ODR_ENCODE) + o->left = o->buflen; } switch (o->direction) { @@ -73,8 +81,8 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) o->bp += rd; o->left -= rd; #ifdef ODR_DEBUG - fprintf(stderr, "\n[class=%d,tag=%d,cons=%d]", class, tag, - *constructed); + fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d,left=%d]", class, tag, + *constructed, o->stackp, o->left); #endif return 1; case ODR_DECODE: @@ -92,8 +100,8 @@ int ber_tag(ODR o, void *p, int class, int tag, int *constructed, int opt) return 0; } #ifdef ODR_DEBUG - fprintf(stderr, "\n[class=%d,tag=%d,cons=%d]", lclass, ltag, - lcons); + fprintf(stderr, "\n[class=%d,tag=%d,cons=%d,stackp=%d]", lclass, ltag, + lcons, o->stackp); #endif } if (class == lclass && tag == ltag)