Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
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
Tobias Hunger
qt-creator
Commits
1a897869
Commit
1a897869
authored
15 years ago
by
Bill King
Browse files
Options
Downloads
Patches
Plain Diff
Fix possible string overrun/overcopy situation.
parent
d074a0bf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/utils/process_stub_unix.c
+4
-2
4 additions, 2 deletions
src/libs/utils/process_stub_unix.c
src/libs/utils/process_stub_win.c
+2
-1
2 additions, 1 deletion
src/libs/utils/process_stub_win.c
with
6 additions
and
3 deletions
src/libs/utils/process_stub_unix.c
+
4
−
2
View file @
1a897869
...
@@ -110,8 +110,9 @@ int main(int argc, char *argv[])
...
@@ -110,8 +110,9 @@ int main(int argc, char *argv[])
perror
(
"Cannot create creator comm socket"
);
perror
(
"Cannot create creator comm socket"
);
doExit
(
3
);
doExit
(
3
);
}
}
memset
(
&
sau
,
0
,
sizeof
(
sau
));
sau
.
sun_family
=
AF_UNIX
;
sau
.
sun_family
=
AF_UNIX
;
strcpy
(
sau
.
sun_path
,
argv
[
ArgSocket
]);
str
n
cpy
(
sau
.
sun_path
,
argv
[
ArgSocket
]
,
sizeof
(
sau
.
sun_path
)
-
1
);
if
(
connect
(
qtcFd
,
(
struct
sockaddr
*
)
&
sau
,
sizeof
(
sau
)))
{
if
(
connect
(
qtcFd
,
(
struct
sockaddr
*
)
&
sau
,
sizeof
(
sau
)))
{
fprintf
(
stderr
,
"Cannot connect creator comm socket %s: %s
\n
"
,
sau
.
sun_path
,
strerror
(
errno
));
fprintf
(
stderr
,
"Cannot connect creator comm socket %s: %s
\n
"
,
sau
.
sun_path
,
strerror
(
errno
));
doExit
(
1
);
doExit
(
1
);
...
@@ -136,7 +137,8 @@ int main(int argc, char *argv[])
...
@@ -136,7 +137,8 @@ int main(int argc, char *argv[])
fseek
(
envFd
,
0
,
SEEK_END
);
fseek
(
envFd
,
0
,
SEEK_END
);
size
=
ftell
(
envFd
);
size
=
ftell
(
envFd
);
rewind
(
envFd
);
rewind
(
envFd
);
envdata
=
malloc
(
size
);
envdata
=
malloc
(
size
+
sizeof
(
char
*
));
envdata
[
size
]
=
0
;
if
(
fread
(
envdata
,
1
,
size
,
envFd
)
!=
(
size_t
)
size
)
{
if
(
fread
(
envdata
,
1
,
size
,
envFd
)
!=
(
size_t
)
size
)
{
perror
(
"Failed to read env file"
);
perror
(
"Failed to read env file"
);
doExit
(
1
);
doExit
(
1
);
...
...
This diff is collapsed.
Click to expand it.
src/libs/utils/process_stub_win.c
+
2
−
1
View file @
1a897869
...
@@ -148,7 +148,8 @@ int main()
...
@@ -148,7 +148,8 @@ int main()
fseek
(
envFd
,
0
,
SEEK_END
);
fseek
(
envFd
,
0
,
SEEK_END
);
size
=
ftell
(
envFd
);
size
=
ftell
(
envFd
);
rewind
(
envFd
);
rewind
(
envFd
);
env
=
malloc
(
size
);
env
=
malloc
(
size
+
sizeof
(
wchar_t
));
env
[
size
]
=
0
;
if
(
fread
(
env
,
1
,
size
,
envFd
)
!=
size
)
{
if
(
fread
(
env
,
1
,
size
,
envFd
)
!=
size
)
{
perror
(
"Failed to read env file"
);
perror
(
"Failed to read env file"
);
doExit
(
1
);
doExit
(
1
);
...
...
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