explicitly set terminating nul byte

This commit is contained in:
darealshinji 2017-12-20 22:00:39 +01:00 committed by GitHub
parent caf91e2408
commit e96f4b3436
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,8 +103,10 @@ void checkrt(char *usr_in_appdir)
bundle_gcc = 1; bundle_gcc = 1;
if (bundle_cxx == 1 || bundle_gcc == 1) { if (bundle_cxx == 1 || bundle_gcc == 1) {
optional_ld_preload = malloc(strlen("LD_PRELOAD=") + strlen(EXEC_SO) + 1 + len); len = strlen(EXEC_SO) + 12 + len;
optional_ld_preload = malloc(len);
sprintf(optional_ld_preload, "LD_PRELOAD=%s/" EXEC_SO, usr_in_appdir); sprintf(optional_ld_preload, "LD_PRELOAD=%s/" EXEC_SO, usr_in_appdir);
optional_ld_preload[len] = '\0';
} }
if (bundle_cxx == 1 && bundle_gcc == 0) { if (bundle_cxx == 1 && bundle_gcc == 0) {