Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
3de6bc74
Commit
3de6bc74
authored
Nov 23, 2017
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dialog.c: fix possible buffer overflows
Fix write past the end of singlePath if PATH contains dirs longer than PATH_MAX.
parent
4a345786
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
Display.c
nx-X11/programs/Xserver/hw/nxagent/Display.c
+13
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/Display.c
View file @
3de6bc74
...
@@ -1842,6 +1842,13 @@ static FILE *nxagentLookForIconFile(char *iconName, const char *permission,
...
@@ -1842,6 +1842,13 @@ static FILE *nxagentLookForIconFile(char *iconName, const char *permission,
if
(
end
!=
NULL
)
if
(
end
!=
NULL
)
{
{
if
((
end
-
path
)
>
sizeof
(
singlePath
)
-
1
)
{
fprintf
(
stderr
,
"Warning: Path too long - ignored.
\n
"
);
path
=
end
+
1
;
continue
;
}
strncpy
(
singlePath
,
path
,
(
unsigned
long
)(
end
-
path
));
strncpy
(
singlePath
,
path
,
(
unsigned
long
)(
end
-
path
));
singlePath
[(
unsigned
long
)(
end
-
path
)]
=
'\0'
;
singlePath
[(
unsigned
long
)(
end
-
path
)]
=
'\0'
;
...
@@ -1850,6 +1857,12 @@ static FILE *nxagentLookForIconFile(char *iconName, const char *permission,
...
@@ -1850,6 +1857,12 @@ static FILE *nxagentLookForIconFile(char *iconName, const char *permission,
}
}
else
else
{
{
if
(
strlen
(
path
)
>
sizeof
(
singlePath
)
-
1
)
{
fprintf
(
stderr
,
"Error: Path too long.
\n
"
);
return
NULL
;
}
strcpy
(
singlePath
,
path
);
strcpy
(
singlePath
,
path
);
breakLoop
=
1
;
breakLoop
=
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