Avoid condition where we could read past the end of lrealm (unlikely
to occur in practice and not remotely exploitable; cell and lrealm are
both MAXKTCREALMLEN and lrealm is configured locally and not read from the
network)
code = KERB_ERR_PKT_VER; /* was KABADTICKET */
goto abort;
}
- if (celllen == 0) strcpy (cell, lrealm);
+ if (celllen == 0) {
+ strncpy (cell, lrealm, MAXKTCREALMLEN-1);
+ cell[MAXKTCREALMLEN-1] = 0;
+ };
if (krb_udp_debug) {
printf ("UGetTicket: got ticket from '%s'.'%s'@'%s'\n",