/*
- * Copyright (c) 1995-2002, Index Data
+ * Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: ber_bool.c,v 1.12 2002-07-25 12:51:08 adam Exp $
+ * $Id: ber_bool.c,v 1.14 2003-03-11 11:03:31 adam Exp $
*/
#if HAVE_CONFIG_H
#endif
return 1;
case ODR_DECODE:
- if ((res = ber_declen(o->bp, &len)) < 0)
+ if ((res = ber_declen(o->bp, &len, odr_max(o))) < 0)
{
- o->error = OPROTO;
+ odr_seterror(o, OPROTO, 9);
return 0;
}
- if (len != 1)
+ o->bp+= res;
+ if (len != 1 || odr_max(o) < len)
{
- o->error = OPROTO;
+ odr_seterror(o, OPROTO, 10);
return 0;
}
- o->bp+= res;
*val = *o->bp;
o->bp++;
#ifdef ODR_DEBUG
return 1;
case ODR_PRINT:
return 1;
- default: o->error = OOTHER; return 0;
+ default: odr_seterror(o, OOTHER, 11); return 0;
}
}