aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2019-01-03 13:21:21 +0100
committerStapleButter <thetotalworm@gmail.com>2019-01-03 13:21:21 +0100
commit172c2eb229eb0d090830b10e8d22904b413da44a (patch)
treea6b9d87d7ee659b8a9c2c290191f9c25fc00c63f /src/libui_sdl
parentb6481a28acba2caa9e5e9033446c9e5285e43f04 (diff)
blfdkgg. I'm a derp.
fix potential buffer overflow.
Diffstat (limited to 'src/libui_sdl')
-rw-r--r--src/libui_sdl/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index 368e8d8..4c17624 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -1654,7 +1654,7 @@ int main(int argc, char** argv)
}
if (len > 0)
{
- EmuDirectory = new char[len];
+ EmuDirectory = new char[len+1];
strncpy(EmuDirectory, argv[0], len);
EmuDirectory[len] = '\0';
}