]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
staging: tidspbridge/pmgr: use strlcpy instead of strncpy
authorChen Gang <gang.chen@asianux.com>
Mon, 21 Jan 2013 09:35:00 +0000 (17:35 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jan 2013 22:00:10 +0000 (14:00 -0800)
  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>
drivers/staging/tidspbridge/pmgr/dbll.c

index 9f07036cd411c1eef4294c38a39a991010243cf5..c191ae20356583a48aaba72526a64c92261c073b 100644 (file)
@@ -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;