Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
a6913f97
Commit
a6913f97
authored
9 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Inotify: Minor code cleanup. Potential fix for [CID 1325796].
parent
1be20a1b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/Inotify/inotify.cmod
+7
-3
7 additions, 3 deletions
src/modules/Inotify/inotify.cmod
with
7 additions
and
3 deletions
src/modules/Inotify/inotify.cmod
+
7
−
3
View file @
a6913f97
...
...
@@ -384,14 +384,18 @@ PIKECLASS _Instance {
}
while
(
THIS
->
buf
.
s
->
len
>=
(
off
+
(
ptrdiff_t
)
sizeof
(
struct
inotify_event
)))
{
/* NB: Assumes that e->len has a valid alignment
* for the struct. This could cause problems
* on non-x86 systems and injected data.
*/
struct
inotify_event
*
e
=
(
void
*
)(
THIS
->
buf
.
s
->
str
+
off
);
const
char
*
path
=
(
char
*
)(
e
+
1
);
if
((
off
+
(
ptrdiff_t
)
sizeof
(
struct
inotify_event
)
+
e
->
len
)
>
THIS
->
buf
.
s
->
len
)
{
ptrdiff_t
new_off
=
off
+
sizeof
(
struct
inotify_event
)
+
e
->
len
;
if
(
new_off
>
THIS
->
buf
.
s
->
len
)
{
/* Not enough data for the filename yet. */
break
;
}
off
+
=
sizeof
(
struct
inotify_event
)
+
e
->
len
;
off
=
new_off
;
push_int
(
e
->
wd
);
push_int
(
e
->
mask
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment