summaryrefslogtreecommitdiffstats
path: root/src/shared/libosmocore/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/libosmocore/src/utils.c')
-rw-r--r--src/shared/libosmocore/src/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/libosmocore/src/utils.c b/src/shared/libosmocore/src/utils.c
index 3ee14abd..e1d4c893 100644
--- a/src/shared/libosmocore/src/utils.c
+++ b/src/shared/libosmocore/src/utils.c
@@ -86,6 +86,8 @@ static char *_osmo_hexdump(const unsigned char *buf, int len, char *delim)
hexd_buff[0] = 0;
for (i = 0; i < len; i++) {
int len_remain = sizeof(hexd_buff) - (cur - hexd_buff);
+ if (len_remain <= 0)
+ break;
int rc = snprintf(cur, len_remain, "%02x%s", buf[i], delim);
if (rc <= 0)
break;