Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f34f794f
Commit
f34f794f
authored
Mar 21, 2003
by
Chris Wright
Committed by
Linus Torvalds
Mar 21, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: potential dereference of user pointer errors in kobil_sct.c
parent
d3598bb2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
15 deletions
+2
-15
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/kobil_sct.c
+2
-15
No files found.
drivers/usb/serial/kobil_sct.c
View file @
f34f794f
...
@@ -406,8 +406,6 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
...
@@ -406,8 +406,6 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
int
result
=
0
;
int
result
=
0
;
int
todo
=
0
;
int
todo
=
0
;
struct
kobil_private
*
priv
;
struct
kobil_private
*
priv
;
int
i
;
char
*
data
;
if
(
count
==
0
)
{
if
(
count
==
0
)
{
dbg
(
"%s - port %d write request of 0 bytes"
,
__FUNCTION__
,
port
->
number
);
dbg
(
"%s - port %d write request of 0 bytes"
,
__FUNCTION__
,
port
->
number
);
...
@@ -421,19 +419,6 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
...
@@ -421,19 +419,6 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
// BEGIN DEBUG
data
=
(
unsigned
char
*
)
kmalloc
((
3
*
count
+
10
)
*
sizeof
(
char
),
GFP_KERNEL
);
if
(
!
data
)
{
return
(
-
1
);
}
memset
(
data
,
0
,
(
3
*
count
+
10
));
for
(
i
=
0
;
i
<
count
;
i
++
)
{
sprintf
(
data
+
3
*
i
,
"%02X "
,
buf
[
i
]);
}
dbg
(
" %d --> %s"
,
port
->
number
,
data
);
kfree
(
data
);
// END DEBUG
// Copy data to buffer
// Copy data to buffer
if
(
from_user
)
{
if
(
from_user
)
{
if
(
copy_from_user
(
priv
->
buf
+
priv
->
filled
,
buf
,
count
))
{
if
(
copy_from_user
(
priv
->
buf
+
priv
->
filled
,
buf
,
count
))
{
...
@@ -443,6 +428,8 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
...
@@ -443,6 +428,8 @@ static int kobil_write (struct usb_serial_port *port, int from_user,
memcpy
(
priv
->
buf
+
priv
->
filled
,
buf
,
count
);
memcpy
(
priv
->
buf
+
priv
->
filled
,
buf
,
count
);
}
}
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
count
,
priv
->
buf
+
priv
->
filled
);
priv
->
filled
=
priv
->
filled
+
count
;
priv
->
filled
=
priv
->
filled
+
count
;
...
...
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