🐞 fix(improve robustness, check input para):

This commit is contained in:
yangwei
2024-08-07 10:56:58 +08:00
committed by luwenpeng
parent 6786372449
commit 21f6a8258b
2 changed files with 3 additions and 0 deletions

View File

@@ -428,6 +428,8 @@ static void on_sess_free(struct session *sess, void *sess_ctx, void *plugin_ctx)
static void on_sess_msg(struct session *sess, int topic_id, const void *msg, void *sess_ctx, void *plugin_ctx)
{
if(msg==NULL)return;// session closing, return directly
char buffer[1024] = {0};
struct packet *pkt = (struct packet *)msg;
struct plugin_ctx *ctx = (struct plugin_ctx *)plugin_ctx;