Skip to content

Commit

Permalink
staging: tidspbridge: fix memory corruption on long string names
Browse files Browse the repository at this point in the history
The value allocated doesn't match the one that is meant to be
stored, resulting in corruption of memory for longer strings
that can't be held in such space.

Fix by allocating the correct byte value for the string meant to
be stored.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Omar Ramirez Luna authored and Greg Kroah-Hartman committed Jan 18, 2013
1 parent 7c25664 commit 94c947c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/tidspbridge/rmgr/dbdcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,7 @@ int dcd_register_object(struct dsp_uuid *uuid_obj,
goto func_end;
}

dcd_key->path = kmalloc(strlen(sz_reg_key) + 1,
GFP_KERNEL);
dcd_key->path = kmalloc(dw_path_size, GFP_KERNEL);

if (!dcd_key->path) {
kfree(dcd_key);
Expand Down

0 comments on commit 94c947c

Please sign in to comment.