Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Fix a format string vulnerability if MALLOC_LOG is set.
Browse files Browse the repository at this point in the history
(cherry picked from commit e443fd3)
  • Loading branch information
codesquid authored and sgtatham committed Oct 17, 2015
1 parent 9c8a3cb commit 3a43bec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ void *safemalloc(size_t n, size_t size)
#else
strcpy(str, "Out of memory!");
#endif
modalfatalbox(str);
modalfatalbox("%s", str);
}
#ifdef MALLOC_LOG
if (fp)
Expand Down Expand Up @@ -778,7 +778,7 @@ void *saferealloc(void *ptr, size_t n, size_t size)
#else
strcpy(str, "Out of memory!");
#endif
modalfatalbox(str);
modalfatalbox("%s", str);
}
#ifdef MALLOC_LOG
if (fp)
Expand Down

0 comments on commit 3a43bec

Please sign in to comment.