2003-02-19 Ken Raeburn <raeburn@mit.edu>
+ * krb5.hin (krb5_princ_component): Return NULL if going off the
+ end of the array.
+
* configure.in: Check for sys/select.h and time.h.
2003-02-07 Tom Yu <tlyu@mit.edu>
#define krb5_princ_size(context, princ) (princ)->length
#define krb5_princ_type(context, princ) (princ)->type
#define krb5_princ_name(context, princ) (princ)->data
-#define krb5_princ_component(context, princ,i) ((princ)->data + i)
+#define krb5_princ_component(context, princ,i) \
+ (((i) < krb5_princ_size(context, princ)) \
+ ? (princ)->data + (i) \
+ : NULL)
/*
* end "base-defs.h"