diff options
author | Jeremy Allison <jra@samba.org> | 2000-11-15 02:39:11 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-11-15 02:39:11 +0000 |
commit | b2b59b93ff1c5bdc43b099e2db1ee86fe8514152 (patch) | |
tree | 1f46c30739587a430f56265849837e0ea7386e4b | |
parent | d43405bc47c95bf8c906035cba23bf95d252d13b (diff) | |
download | samba-b2b59b93ff1c5bdc43b099e2db1ee86fe8514152.tar.gz samba-b2b59b93ff1c5bdc43b099e2db1ee86fe8514152.tar.xz samba-b2b59b93ff1c5bdc43b099e2db1ee86fe8514152.zip |
Uninitialized memory read fixes.
open_file_shared takes a DOS pathname, not a UNIX one.
Jeremy.
-rw-r--r-- | source/printing/nt_printing.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c index 2c329c78a58..895e3c6b052 100644 --- a/source/printing/nt_printing.c +++ b/source/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), |