Module: wine
Branch: refs/heads/master
Commit: 3f2da592ad4e7f113f59b7df435a51ef1721af12
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=3f2da592ad4e7f113f59b7d…
Author: Alexandre Julliard <julliard(a)winehq.org>
Date: Wed Jul 19 20:04:45 2006 +0200
ntdll: Null-terminate strings returned by VFAT_IOCTL_READDIR_BOTH to work around a kernel bug.
---
dlls/ntdll/directory.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
index 14a71b4..faeca6c 100644
--- a/dlls/ntdll/directory.c
+++ b/dlls/ntdll/directory.c
@@ -911,6 +911,9 @@ static int read_directory_vfat( int fd,
while (res != -1)
{
if (!de[0].d_reclen) break;
+ /* make sure names are null-terminated to work around an x86-64 kernel bug */
+ if (de[0].d_reclen < sizeof(de[0].d_name)) de[0].d_name[de[0].d_reclen] = 0;
+ if (de[1].d_reclen < sizeof(de[1].d_name)) de[1].d_name[de[1].d_reclen] = 0;
if (de[1].d_name[0])
info = append_entry( buffer, &io->Information, length,
de[1].d_name, de[0].d_name, mask );
@@ -942,6 +945,9 @@ static int read_directory_vfat( int fd,
while (res != -1)
{
if (!de[0].d_reclen) break;
+ /* make sure names are null-terminated to work around an x86-64 kernel bug */
+ if (de[0].d_reclen < sizeof(de[0].d_name)) de[0].d_name[de[0].d_reclen] = 0;
+ if (de[1].d_reclen < sizeof(de[1].d_name)) de[1].d_name[de[1].d_reclen] = 0;
if (de[1].d_name[0])
info = append_entry( buffer, &io->Information, length,
de[1].d_name, de[0].d_name, mask );
@@ -1247,6 +1253,9 @@ #ifdef VFAT_IOCTL_READDIR_BOTH
for (;;)
{
if (!de[0].d_reclen) break;
+ /* make sure names are null-terminated to work around an x86-64 kernel bug */
+ if (de[0].d_reclen < sizeof(de[0].d_name)) de[0].d_name[de[0].d_reclen] = 0;
+ if (de[1].d_reclen < sizeof(de[1].d_name)) de[1].d_name[de[1].d_reclen] = 0;
if (de[1].d_name[0])
{
ChangeSet ID: 26671
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner(a)winehq.org 2006/07/19 22:52:02
Modified files:
include : comment.php
Log message:
Chris Morgan <cmorgan(a)alum.wpi.edu>
Attempt to capture the source of erroneous input to grab_comments() using error_log::logBackTrace()
Patch: http://cvs.winehq.org/patch.py?id=26671
Old revision New revision Changes Path
1.28 1.29 +10 -0 appdb/include/comment.php
Index: appdb/include/comment.php
diff -u -p appdb/include/comment.php:1.28 appdb/include/comment.php:1.29
--- appdb/include/comment.php:1.28 20 Jul 2006 3:52: 2 -0000
+++ appdb/include/comment.php 20 Jul 2006 3:52: 2 -0000
@@ -254,6 +254,16 @@ class Comment {
*/
function grab_comments($iVersionId, $iParentId = null)
{
+ /* TODO: remove the logging when we figure out where the */
+ /* invalid $iVersionId is coming */
+ /* if $iVersionId is invalid we should log where we came from */
+ /* so we can debug the problem */
+ if($iVersionId == "")
+ {
+ error_log::logBackTrace("logging iVersionId oddity");
+ return NULL;
+ }
+
/* escape input so we can use query_appdb() without concern */
$iVersionId = mysql_real_escape_string($iVersionId);
$iParentId = mysql_real_escape_string($iParentId);