From 0f2955168ddfcf2b2a2589c2cb17558f8bc9e8de Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sat, 26 Aug 1995 16:48:45 +0000 Subject: [PATCH] * krb5_encode_test.c (encoder_print_results): If trval2 returns non zero, indicate with error before exiting. * trval.c (do_cons): Initialize return value to zero in case of zero length data. (instead of random stack value). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6596 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/asn.1/ChangeLog | 9 +++++++++ src/tests/asn.1/krb5_encode_test.c | 4 +++- src/tests/asn.1/trval.c | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/tests/asn.1/ChangeLog b/src/tests/asn.1/ChangeLog index f5d4b1420..4dca4c1b8 100644 --- a/src/tests/asn.1/ChangeLog +++ b/src/tests/asn.1/ChangeLog @@ -1,3 +1,12 @@ +Sat Aug 26 12:40:57 1995 Ezra Peisach + + * krb5_encode_test.c (encoder_print_results): If trval2 returns + non zero, indicate with error before exiting. + + * trval.c (do_cons): Initialize return value to zero in case of + zero length data. (instead of random stack value). + + Fri Aug 25 21:50:37 1995 Theodore Y. Ts'o * krb5_encode_test.c (main): Add tests for diff --git a/src/tests/asn.1/krb5_encode_test.c b/src/tests/asn.1/krb5_encode_test.c index c7b3487d4..6adebbd82 100644 --- a/src/tests/asn.1/krb5_encode_test.c +++ b/src/tests/asn.1/krb5_encode_test.c @@ -30,8 +30,10 @@ void encoder_print_results(code, typestring, description) code->length, rlen); exit(1); } - if (r != 0) + if (r != 0) { + printf("Error: Return from trval2 is %d.\n", r); exit(1); + } } else { retval = asn1_krb5_data_unparse(code,&(code_string)); if(retval) { diff --git a/src/tests/asn.1/trval.c b/src/tests/asn.1/trval.c index 71e3102e3..5e85bb813 100644 --- a/src/tests/asn.1/trval.c +++ b/src/tests/asn.1/trval.c @@ -182,6 +182,7 @@ int trval2(fp, enc, len, lev, rlen) int l, eid, elen, xlen, r, rlen2; int rlen_ext = 0; + if (len < 2) { fprintf(fp, "missing id and length octets (%d)\n", len); return(NOTOK); @@ -312,7 +313,7 @@ int lev; int *rlen; { int n; - int r; + int r = 0; int rlen2; int rlent; -- 2.26.2