fix a buffer overflow bug

This commit is contained in:
Solar Flare 2019-11-06 06:45:52 +08:00
parent 86408cd806
commit 0a8663c845

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