From 20b00dd58164de1084fd9bb633b3186972411961 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 6 Jan 2006 20:03:52 +0000 Subject: Don't dereference a null pointer. Fixes bug 651. Update the release notes accordingly. svn path=/trunk/; revision=16967 --- asn1/h248/packet-h248-template.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'asn1') diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c index 98cec4e6f1..18da5ffbc0 100644 --- a/asn1/h248/packet-h248-template.c +++ b/asn1/h248/packet-h248-template.c @@ -1189,7 +1189,7 @@ static h248_trx_t* h248_trx(h248_msg_t* m ,guint32 t_id , h248_trx_type_t type) if (m->commited) { for ( trxmsg = m->trxs; trxmsg; trxmsg = trxmsg->next) { - if (trxmsg->trx->id == t_id) { + if (trxmsg->trx && trxmsg->trx->id == t_id) { return trxmsg->trx; } } @@ -1390,6 +1390,7 @@ static h248_cmd_t* h248_cmd(h248_msg_t* m, h248_trx_t* t, h248_ctx_t* c, h248_cm cmdctx->last = cmdtrx->last = NULL; if (t->cmds) { + DISSECTOR_ASSERT(t->cmds->last != NULL); t->cmds->last->next = cmdtrx; t->cmds->last = cmdtrx; } else { @@ -1398,6 +1399,7 @@ static h248_cmd_t* h248_cmd(h248_msg_t* m, h248_trx_t* t, h248_ctx_t* c, h248_cm } if (c->cmds) { + DISSECTOR_ASSERT(c->cmds->last != NULL); c->cmds->last->next = cmdctx; c->cmds->last = cmdctx; } else { -- cgit v1.2.3