diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2019-04-12 21:48:07 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2019-04-12 21:48:11 +0700 |
commit | 4f619c202c67dd68b1c3a13d40ad50fa2a6e582d (patch) | |
tree | fb2bced9a093aa8bbab94aeebc1e1e7de4bfbd37 /src/socket.c | |
parent | b480b74192a7c00c4ea077286b921b96e42efabc (diff) |
Fix incorrect buffer size calculation
Calling sizeof() on a pointer to dynamically allocated memory would
result in getting size of the pointer (usually 4 or 8 bytes) itself,
but not the size of allocated memory.
Change-Id: I8ffda4dea2b7f9b4b76dfeecad1fab6384c5a62c
Fixes: CID#197629, CID#197628, CID#197627
Fixes: CID#197626, CID#197625, CID#197624
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c index c817e723..7c412b66 100644 --- a/src/socket.c +++ b/src/socket.c @@ -837,7 +837,7 @@ char *osmo_sock_get_name2_c(const void *ctx, int fd) char *str = talloc_size(ctx, OSMO_SOCK_NAME_MAXLEN); if (!str) return NULL; - osmo_sock_get_name_buf(str, sizeof(str), fd); + osmo_sock_get_name_buf(str, OSMO_SOCK_NAME_MAXLEN, fd); return str; } |