Skip to content

Commit

Permalink
Fix buffer overflow in Backup.Creator
Browse files Browse the repository at this point in the history
I noticed that while testing the upcoming GCC 12 with -D_FORTIFY_SOURCE=3:
here I have

$1 = 0x7ffff7f0f940 <Buffer.1.lto_priv.1> "Linux, kernel 5.16.14-1-default (#1 SMP PREEMPT Fri Mar 11 12:33:34 UTC 2022 (80acc65))"
(gdb) p (int)strlen(GetOS())
$3 = 87
so GetOS() returns 87 chars while:

include/gammu-backup.h: char Creator[80];

Fixes: #701
  • Loading branch information
marxin authored and nijel committed Jun 20, 2022
1 parent 6bae485 commit a37e5d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/gammu-backup.h
Expand Up @@ -218,7 +218,7 @@ typedef struct {
/**
* Name of program which created backup
*/
char Creator[80];
char Creator[512];
/**
* Timestamp of backup
*/
Expand Down

0 comments on commit a37e5d8

Please sign in to comment.