# Copyright (C) 1994, Index Data I/S
# All rights reserved.
# Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.5 1995-03-08 12:11:59 quinn Exp $
+# $Id: Makefile,v 1.6 1995-03-10 11:44:40 quinn Exp $
SHELL=/bin/sh
INCLUDE=-I../include -I.
-#CFLAGS= -g -Wall -pedantic -ansi -DODR_DEBUG
+CFLAGS= -g -Wall -pedantic -ansi -DODR_DEBUG
DEFS=$(INCLUDE)
LIB=odr.a
PO = odr_bool.o ber_bool.o ber_len.o ber_tag.o odr_util.o odr_null.o \
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: ber_tag.c,v $
- * Revision 1.7 1995-03-08 12:12:13 quinn
+ * 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
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]", class, tag,
+ *constructed, o->stackp);
#endif
return 1;
case ODR_DECODE:
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)
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: odr.c,v $
- * Revision 1.6 1995-03-08 12:12:15 quinn
+ * Revision 1.7 1995-03-10 11:44:41 quinn
+ * Fixed serious stack-bug in odr_cons_begin
+ *
+ * Revision 1.6 1995/03/08 12:12:15 quinn
* Added better error checking.
*
* Revision 1.5 1995/03/07 13:28:57 quinn
"Unexpected tag",
"Other error",
"Protocol error",
- "Malformed data"
+ "Malformed data",
+ "Stack overflow"
};
void odr_perror(ODR o, char *message)
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: odr_cons.c,v $
- * Revision 1.6 1995-03-08 12:12:23 quinn
+ * Revision 1.7 1995-03-10 11:44:41 quinn
+ * Fixed serious stack-bug in odr_cons_begin
+ *
+ * Revision 1.6 1995/03/08 12:12:23 quinn
* Added better error checking.
*
* Revision 1.5 1995/02/10 18:57:25 quinn
if (!res || !cons)
return 0;
+ if (o->stackp == ODR_MAX_STACK - 1)
+ {
+ o->error = OSTACK;
+ return 0;
+ }
o->stack[++(o->stackp)].lenb = o->bp;
if (o->direction == ODR_ENCODE || o->direction == ODR_PRINT)
{
if (*o->bp++ == 0 && *(o->bp++) == 0)
{
o->left -= 2;
+ o->stackp--;
return 1;
}
else