Skip to content

Commit 210e2c0

Browse files
committed
fix too short buffer size
1 parent 41ce96b commit 210e2c0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/state_bcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void state_bcm()
240240
}
241241

242242
// Construct the format string for the dynamically based on frame.len
243-
char format[256];
243+
char format[512];
244244
snprintf(format, sizeof(format), "< %%*s %%x %%hhx %%hhu");
245245
for (int i = 0; i < msg.frame.len; i++) {
246246
strncat(format, " %hhx", sizeof(format) - strlen(format) - 1);

src/state_raw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ void state_raw()
242242
}
243243

244244
// Construct the format string dynamically based on frame.len
245-
char format[256];
245+
char format[512];
246246
snprintf(format, sizeof(format), "< %%*s %%x %%hhx %%hhu");
247247
for (int i = 0; i < frame.len; i++) {
248248
strncat(format, " %hhx", sizeof(format) - strlen(format) - 1);

0 commit comments

Comments
 (0)