Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3e5a9565
Commit
3e5a9565
authored
Dec 11, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Jan 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
twain_32: Handle realloc failure in twain_add_onedriver (cppcheck).
parent
89f1d626
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
dsm_ctrl.c
dlls/twain_32/dsm_ctrl.c
+5
-1
No files found.
dlls/twain_32/dsm_ctrl.c
View file @
3e5a9565
...
@@ -53,6 +53,7 @@ twain_add_onedriver(const WCHAR *dsname) {
...
@@ -53,6 +53,7 @@ twain_add_onedriver(const WCHAR *dsname) {
DSENTRYPROC
dsEntry
;
DSENTRYPROC
dsEntry
;
TW_IDENTITY
fakeOrigin
;
TW_IDENTITY
fakeOrigin
;
TW_IDENTITY
sourceId
;
TW_IDENTITY
sourceId
;
struct
all_devices
*
new_devices
;
TW_UINT16
ret
;
TW_UINT16
ret
;
WCHAR
path
[
MAX_PATH
];
WCHAR
path
[
MAX_PATH
];
...
@@ -89,7 +90,10 @@ twain_add_onedriver(const WCHAR *dsname) {
...
@@ -89,7 +90,10 @@ twain_add_onedriver(const WCHAR *dsname) {
}
}
if
(
i
<
nrdevices
)
if
(
i
<
nrdevices
)
break
;
break
;
devices
=
realloc
(
devices
,
sizeof
(
devices
[
0
])
*
(
nrdevices
+
1
)
);
new_devices
=
realloc
(
devices
,
sizeof
(
devices
[
0
])
*
(
nrdevices
+
1
)
);
if
(
!
new_devices
)
break
;
devices
=
new_devices
;
devices
[
nrdevices
].
modname
=
wcsdup
(
path
);
devices
[
nrdevices
].
modname
=
wcsdup
(
path
);
devices
[
nrdevices
].
identity
=
sourceId
;
devices
[
nrdevices
].
identity
=
sourceId
;
nrdevices
++
;
nrdevices
++
;
...
...
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