From 5afef298d6adf6bd6ef852c455647f662a24c995 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 1 Apr 2014 21:51:18 -0400 Subject: osx: Use safe string functions for launcher. The OS X launcher used a few unsafe string functions; use snprintf() or strlcpy,strlcat here - as this is the launcher for OS X we don't need to care about portability. --- pkg/osx/Execute.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkg/osx/Execute.m') diff --git a/pkg/osx/Execute.m b/pkg/osx/Execute.m index 0dcfbb7c..0dd6c9a3 100644 --- a/pkg/osx/Execute.m +++ b/pkg/osx/Execute.m @@ -75,8 +75,7 @@ static void DoExec(const char *executable, const char *iwad, const char *args) { char *argv[3]; - argv[0] = malloc(strlen(executable_path) + strlen(executable) + 3); - sprintf(argv[0], "%s/%s", executable_path, executable); + asprintf(&argv[0], "%s/%s", executable_path, executable); if (iwad != NULL || args != NULL) { -- cgit v1.2.3