From 14355a6434952071e862af3a1e7bcfbbf640a6a3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Nov 2000 02:39:11 +0000 Subject: Uninitialized memory read fixes. open_file_shared takes a DOS pathname, not a UNIX one. Jeremy. (This used to be commit b2b59b93ff1c5bdc43b099e2db1ee86fe8514152) --- source3/printing/nt_printing.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 2c329c78a58..895e3c6b052 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -359,6 +359,8 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in, struct passwd *pass; connection_struct *conn; + ZERO_STRUCT(st); + /* If architecture is Windows 95/98, the version is always 0. */ if (strcmp(architecture, "WIN40") == 0) { DEBUG(10,("get_correct_cversion: Driver is Win9x, cversion = 0\n")); @@ -404,7 +406,6 @@ static uint32 get_correct_cversion(fstring architecture, fstring driverpath_in, /* Open the driver file (Portable Executable format) and determine the * deriver the cversion. */ slprintf(driverpath, sizeof(driverpath), "%s/%s", architecture, driverpath_in); - dos_to_unix(driverpath, True); fsp = open_file_shared(conn, driverpath, &st, SET_OPEN_MODE(DOS_OPEN_RDONLY), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), @@ -958,9 +959,13 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, SMB_STRUCT_STAT st; SMB_STRUCT_STAT stat_buf; + ZERO_STRUCT(st); + ZERO_STRUCT(stat_buf); + new_create_time = (time_t)0; + old_create_time = (time_t)0; + /* Get file version info (if available) for previous file (if it exists) */ pstrcpy(filepath, old_file); - dos_to_unix(filepath, True); fsp = open_file_shared(conn, filepath, &stat_buf, SET_OPEN_MODE(DOS_OPEN_RDONLY), @@ -991,7 +996,6 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, /* Get file version info (if available) for new file */ pstrcpy(filepath, new_file); - dos_to_unix(filepath, True); fsp = open_file_shared(conn, filepath, &stat_buf, SET_OPEN_MODE(DOS_OPEN_RDONLY), (FILE_FAIL_IF_NOT_EXIST|FILE_EXISTS_OPEN), -- cgit