+2004-12-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * libltdl/ltdl.c [cygwin, mingw] (opendir): Fix write of constant
+ strings past end of buffer.
+ (opendir, readdir): Fix read past end of buffer.
+
2004-12-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* README-alpha: Update list of non-Libtool-owned files.
DIR *entry;
assert(path != (char *) NULL);
- (void) strncpy(file_specification,path,LT_FILENAME_MAX-1);
+ /* allow space for: path + '\\' '\\' '*' '.' '*' + '\0' */
+ (void) strncpy (file_specification, path, LT_FILENAME_MAX-6);
+ file_specification[LT_FILENAME_MAX-6] = LT_EOS_CHAR;
(void) strcat(file_specification,"\\");
entry = LT_DLMALLOC (DIR,sizeof(DIR));
if (entry != (DIR *) 0)
entry->firsttime = FALSE;
(void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName,
LT_FILENAME_MAX-1);
+ entry->file_info.d_name[LT_FILENAME_MAX - 1] = LT_EOS_CHAR;
entry->file_info.d_namlen = strlen(entry->file_info.d_name);
return(&entry->file_info);
}