diff options
author | Dimitri Staessens <[email protected]> | 2024-02-24 17:13:06 +0100 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2024-02-26 08:59:15 +0100 |
commit | 12c3298335c48fcdd1551c1474f9afe07e9a067f (patch) | |
tree | b6d847d56ac9cdf5ad8d5dfed0f791e19d4d0c55 /src/irmd/ipcp.c | |
parent | 82aec24db65fd3bf06f60a8952c1b0b3dfd05ec4 (diff) | |
download | ouroboros-12c3298335c48fcdd1551c1474f9afe07e9a067f.tar.gz ouroboros-12c3298335c48fcdd1551c1474f9afe07e9a067f.zip |
irmd: Fix wrong hash length when getting ipcpd
The get_ipcpd_by_dst function was returning the hash length of the
last IPCP in the list instead of the length of the actual hash.
Signed-off-by: Dimitri Staessens <[email protected]>
Signed-off-by: Sander Vrijders <[email protected]>
Diffstat (limited to 'src/irmd/ipcp.c')
-rw-r--r-- | src/irmd/ipcp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/irmd/ipcp.c b/src/irmd/ipcp.c index d7abe15d..5a9a79d3 100644 --- a/src/irmd/ipcp.c +++ b/src/irmd/ipcp.c @@ -107,7 +107,8 @@ ipcp_msg_t * send_recv_ipcp_msg(pid_t pid, free(sock_path); len = ipcp_msg__get_packed_size(msg); - if (len == 0) { + if (len == 0 || len >= SOCK_BUF_SIZE) { + log_warn("IPCP message has invalid size: %zd.", len); close(sockfd); return NULL; } |