Module: kamailio
Branch: master
Commit: cae0f9a1302a79d748155401117e934a5a8e272f
URL:
https://github.com/kamailio/kamailio/commit/cae0f9a1302a79d748155401117e934…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-12-13T11:24:24+01:00
ratelimit: reorder for safer storage size
---
Modified: src/modules/ratelimit/rl_statistics.c
---
Diff:
https://github.com/kamailio/kamailio/commit/cae0f9a1302a79d748155401117e934…
Patch:
https://github.com/kamailio/kamailio/commit/cae0f9a1302a79d748155401117e934…
---
diff --git a/src/modules/ratelimit/rl_statistics.c
b/src/modules/ratelimit/rl_statistics.c
index 237c7acd9a2..4e00dbeda38 100644
--- a/src/modules/ratelimit/rl_statistics.c
+++ b/src/modules/ratelimit/rl_statistics.c
@@ -182,7 +182,7 @@ int get_socket_list_from_proto_and_family(
return 0;
}
- *ipList = pkg_malloc(numberOfSockets * (num_ip_octets + 1) * sizeof(int));
+ *ipList = pkg_malloc(sizeof(int) * numberOfSockets * (num_ip_octets + 1));
/* We couldn't allocate memory for the IP List. So all we can do is
* fail. */