this won't happen as the rest of the code is sane, but it's good
to double-check the values to be sure.
request->module = NULL;
fr_assert(request->proto_dict == dict_tls);
+ /*
+ * Success, failure, and notfound are not TLS packets that we
+ */
+ if (!request->packet->code || (request->packet->code > FR_PACKET_TYPE_VALUE_ESTABLISH_SESSION)) {
+ REDEBUG("Invalid packet code %u", request->packet->code);
+ RETURN_UNLANG_FAIL;
+ }
+
UPDATE_STATE(packet);
log_request_pair_list(L_DBG_LVL_1, request, NULL, &request->request_pairs, NULL);