neels has uploaded this change for review. (
https://gerrit.osmocom.org/c/libasn1c/+/37987?usp=email )
Change subject: coverity CID#27227
......................................................................
coverity CID#27227
Pass the proper sizeof() argument.
Use larger buffers, the string format suggests likely lengths > 31.
Change-Id: I009735b8b5c47aa0a8369cda2abb946507b92150
---
M src/per_support.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libasn1c refs/changes/87/37987/1
diff --git a/src/per_support.c b/src/per_support.c
index d536bc0..a1c5ae7 100644
--- a/src/per_support.c
+++ b/src/per_support.c
@@ -9,10 +9,10 @@
char *
per_data_string(asn_per_data_t *pd) {
- static char buf[2][32];
+ static char buf[2][64];
static int n;
n = (n+1) % 2;
- snprintf(buf[n], sizeof(buf),
+ snprintf(buf[n], sizeof(buf[0]),
"{m=%ld span %+ld[%d..%d] (%d)}",
(long)pd->moved,
(((long)pd->buffer) & 0xf),
--
To view, visit
https://gerrit.osmocom.org/c/libasn1c/+/37987?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libasn1c
Gerrit-Branch: master
Gerrit-Change-Id: I009735b8b5c47aa0a8369cda2abb946507b92150
Gerrit-Change-Number: 37987
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>