diff --git a/lib/sdp.c b/lib/sdp.c
index 1f19953..2107e28 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
goto end;
}
- if (n == 0 || reqhdr->tid != rsphdr->tid ||
- (n != (int) (ntohs(rsphdr->plen) + sizeof(sdp_pdu_hdr_t)))) {
+ if (reqhdr->tid != rsphdr->tid) {
t->err = EPROTO;
- SDPERR("Protocol error.");
+ SDPERR("Protocol error: transaction id does not match");
+ goto end;
+ }
+
+ if (n != (int) (ntohs(rsphdr->plen) + sizeof(sdp_pdu_hdr_t))) {
+ t->err = EPROTO;
+ SDPERR("Protocol error: invalid length");
goto end;
}