Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e979832d
Commit
e979832d
authored
Feb 08, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fixed handling of inotify record length.
parent
d815b507
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
change.c
server/change.c
+7
-5
No files found.
server/change.c
View file @
e979832d
...
@@ -416,7 +416,8 @@ static void inotify_do_change_notify( struct dir *dir, struct inotify_event *ie
...
@@ -416,7 +416,8 @@ static void inotify_do_change_notify( struct dir *dir, struct inotify_event *ie
if
(
dir
->
want_data
)
if
(
dir
->
want_data
)
{
{
record
=
malloc
(
sizeof
(
*
record
)
+
ie
->
len
-
1
)
;
size_t
len
=
strlen
(
ie
->
name
);
record
=
malloc
(
offsetof
(
struct
change_record
,
name
[
len
])
);
if
(
!
record
)
if
(
!
record
)
return
;
return
;
...
@@ -426,8 +427,8 @@ static void inotify_do_change_notify( struct dir *dir, struct inotify_event *ie
...
@@ -426,8 +427,8 @@ static void inotify_do_change_notify( struct dir *dir, struct inotify_event *ie
record
->
action
=
FILE_ACTION_REMOVED
;
record
->
action
=
FILE_ACTION_REMOVED
;
else
else
record
->
action
=
FILE_ACTION_MODIFIED
;
record
->
action
=
FILE_ACTION_MODIFIED
;
memcpy
(
record
->
name
,
ie
->
name
,
ie
->
len
);
memcpy
(
record
->
name
,
ie
->
name
,
len
);
record
->
len
=
strlen
(
ie
->
name
)
;
record
->
len
=
len
;
list_add_tail
(
&
dir
->
change_records
,
&
record
->
entry
);
list_add_tail
(
&
dir
->
change_records
,
&
record
->
entry
);
}
}
...
@@ -456,13 +457,14 @@ static void inotify_poll_event( struct fd *fd, int event )
...
@@ -456,13 +457,14 @@ static void inotify_poll_event( struct fd *fd, int event )
return
;
return
;
}
}
for
(
ofs
=
0
;
ofs
<
r
;
)
for
(
ofs
=
0
;
ofs
<
r
-
offsetof
(
struct
inotify_event
,
name
)
;
)
{
{
ie
=
(
struct
inotify_event
*
)
&
buffer
[
ofs
];
ie
=
(
struct
inotify_event
*
)
&
buffer
[
ofs
];
if
(
!
ie
->
len
)
if
(
!
ie
->
len
)
break
;
break
;
ofs
+=
offsetof
(
struct
inotify_event
,
name
[
ie
->
len
]
);
if
(
ofs
>
r
)
break
;
inotify_do_change_notify
(
dir
,
ie
);
inotify_do_change_notify
(
dir
,
ie
);
ofs
+=
(
sizeof
(
*
ie
)
+
ie
->
len
-
1
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment