Skip to content

Commit

Permalink
staging: tidspbridge/pmgr: use strlcpy instead of strncpy
Browse files Browse the repository at this point in the history
  The fields must be null-terminated,
  or next strcpy in dbll_find_dsp_symbol, will cause issue

additoinal info:
  dbll_find_dsp_symbol call find_symbol_callback to get name.
  and then call strcpy to copy the name to upper caller.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Cc: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chen Gang authored and Greg Kroah-Hartman committed Jan 21, 2013
1 parent ec7e0ae commit 9814a87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/tidspbridge/pmgr/dbll.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ void find_symbol_callback(void *elem, void *user_data)
offset < context->cur_best_offset) {
context->cur_best_offset = offset;
context->sym_addr = symbol_addr;
strncpy(context->name, symbol->name, sizeof(context->name));
strlcpy(context->name, symbol->name, sizeof(context->name));
}

return;
Expand Down

0 comments on commit 9814a87

Please sign in to comment.