misc: tegra-profiler: fix coverity defect
Igor Nabirushkin [Sat, 4 Jun 2016 09:10:08 +0000 (13:10 +0400)]
Fix coverity defect "Buffer not null terminated".

Coverity ID 23890

Bug 200192567

Change-Id: I5c55c7f0460b45a9185eb790338fc01b301bb10c
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/1171551
(cherry picked from commit 2d10b141f51e39602f1fe4c566c55ad3db184b07)
Reviewed-on: http://git-master/r/1249582
(cherry picked from commit 4e8a826423196af98fbdc0a5adc5d14b696e75b5)

drivers/misc/tegra-profiler/auth.c

index 7a89ba5..e324584 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * drivers/misc/tegra-profiler/auth.c
  *
- * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -256,7 +256,7 @@ int quadd_auth_is_debuggable(const char *package_name)
        data->debug_app_uid = 0;
        data->response_value = 0;
 
-       strncpy(data->package_name, package_name, QUADD_MAX_PACKAGE_NAME);
+       strlcpy(data->package_name, package_name, QUADD_MAX_PACKAGE_NAME);
        mutex_unlock(&auth_ctx.lock);
 
        request_ready();