From: Brendan Shanks bshanks@codeweavers.com
--- dlls/mountmgr.sys/unixlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/mountmgr.sys/unixlib.c b/dlls/mountmgr.sys/unixlib.c index b74b2336a34..9d7cd904769 100644 --- a/dlls/mountmgr.sys/unixlib.c +++ b/dlls/mountmgr.sys/unixlib.c @@ -127,7 +127,7 @@ static void detect_devices( const char **paths, char *names, ULONG size )
for (;;) { - int len = sprintf( unix_path, *paths, i++ ); + int len = snprintf( unix_path, sizeof(unix_path), *paths, i++ ); if (len + 2 > size) break; if (access( unix_path, F_OK ) != 0) break; strcpy( names, unix_path );
From: Brendan Shanks bshanks@codeweavers.com
--- dlls/mountmgr.sys/unixlib.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-)
diff --git a/dlls/mountmgr.sys/unixlib.c b/dlls/mountmgr.sys/unixlib.c index 9d7cd904769..47c42d939c6 100644 --- a/dlls/mountmgr.sys/unixlib.c +++ b/dlls/mountmgr.sys/unixlib.c @@ -89,22 +89,14 @@ static NTSTATUS errno_to_status( int err )
static char *get_dosdevices_path( const char *dev ) { - const char *home = getenv( "HOME" ); const char *prefix = getenv( "WINEPREFIX" ); - size_t len = (prefix ? strlen(prefix) : strlen(home) + strlen("/.wine")) + sizeof("/dosdevices/") + strlen(dev); - char *path = malloc( len ); + char *path = NULL; + + if (prefix) + asprintf( &path, "%s/dosdevices/%s", prefix, dev ); + else + asprintf( &path, "%s/.wine/dosdevices/%s", getenv( "HOME" ), dev );
- if (path) - { - if (prefix) strcpy( path, prefix ); - else - { - strcpy( path, home ); - strcat( path, "/.wine" ); - } - strcat( path, "/dosdevices/" ); - strcat( path, dev ); - } return path; }
@@ -420,9 +412,9 @@ static NTSTATUS read_volume_file( void *args ) { const struct read_volume_file_params *params = args; int ret, fd = -1; - char *name = malloc( strlen(params->volume) + strlen(params->file) + 2 ); + char *name = NULL;
- sprintf( name, "%s/%s", params->volume, params->file ); + asprintf( &name, "%s/%s", params->volume, params->file );
if (name[0] != '/') { @@ -508,9 +500,7 @@ static NTSTATUS set_shell_folder( void *args ) if (link && (!strcmp( link, "$HOME" ) || !strncmp( link, "$HOME/", 6 )) && (home = getenv( "HOME" ))) { link += 5; - homelink = malloc( strlen(home) + strlen(link) + 1 ); - strcpy( homelink, home ); - strcat( homelink, link ); + asprintf( &homelink, "%s%s", home, link ); link = homelink; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=143969
Your paranoid android.
=== debian11b (64 bit WoW report) ===
secur32: schannel.c:538: Test failed: cert_cnt = 2