Module: kamailio
Branch: 5.3
Commit: e83a966b69500a9b30ba41858beee77d154a3b4d
URL:
https://github.com/kamailio/kamailio/commit/e83a966b69500a9b30ba41858beee77…
Author: Stefan Mititelu <stefan.mititelu92(a)gmail.com>
Committer: Stefan Mititelu <stefan.mititelu92(a)gmail.com>
Date: 2020-02-28T13:43:13+02:00
pdbt: add pdb server message check
Related to 3c07e2351a94e4ff2cf3c6b9b9df4d7462cd5760 commit, but on server side.
(cherry picked from commit 7db39bbc128233ae663061364c5545648e06d3a7)
---
Modified: utils/pdbt/common.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e83a966b69500a9b30ba41858beee77…
Patch:
https://github.com/kamailio/kamailio/commit/e83a966b69500a9b30ba41858beee77…
---
diff --git a/utils/pdbt/common.c b/utils/pdbt/common.c
index cd7b6558c4..f5bc54ecc8 100644
--- a/utils/pdbt/common.c
+++ b/utils/pdbt/common.c
@@ -11,9 +11,15 @@ void pdb_msg_dbg(struct pdb_msg msg) {
LERR("id = %d\n", msg.hdr.id);
LERR("len = %d\n", msg.hdr.length);
LERR("payload = ");
- for (i = 0; i < msg.hdr.length - sizeof(msg.hdr); i++) {
- LERR("%02X ", msg.bdy.payload[i]);
+
+ if(msg.hdr.length > sizeof(msg.hdr)) {
+ for (i = 0; i < msg.hdr.length - sizeof(msg.hdr); i++) {
+ LERR("%02X ", msg.bdy.payload[i]);
+ }
+ } else {
+ LERR("Incorrect value in msg.hdr.length \n");
}
+
LERR("\n");
return ;