fix a buffer overflow bug

pull/307/head
Solar Flare 2019-11-06 06:45:52 +08:00
parent 86408cd806
commit 0a8663c845
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ static void set_own_dir(const char *argv0) {
size_t l = strlen(argv0);
while(l && argv0[l - 1] != '/')
l--;
if(l == 0)
if(l == 0 || l >= sizeof(own_dir))
#ifdef SUPER_SECURE
memcpy(own_dir, "/dev/null/", 11);
#else