Prevent too large protoop write_frame* without a current_plugin from crashing
@@ -2547,8 +2547,12 @@ protoop_arg_t prepare_packet_ready(picoquic_cnx_t *cnx)
length += (uint32_t) data_bytes;
} else {
if (data_bytes > rfs->nb_bytes) {
+ if (cnx->current_plugin != NULL)
printf("WARNING: plugin %s reserved frame %lu for %lu bytes, but wrote %lu; erasing the frame\n",
cnx->current_plugin->name, rfs->frame_type, rfs->nb_bytes, data_bytes);
+ else
+ printf("WARNING: plugin %p reserved frame %lu for %lu bytes, but wrote %lu; erasing the frame\n",
+ cnx->current_plugin, rfs->frame_type, rfs->nb_bytes, data_bytes);
}
memset(&bytes[length], 0, rfs->nb_bytes);
}
