perf probe: Fix unchecked usage of strncpy()
[linux-2.6-block.git] / tools / perf / util / probe-file.c
index aac7817d9e14dda07978f46b32a6e20857822bce..0b1195cad0e5b7be9048b4386ff01e9c59c0b305 100644 (file)
@@ -424,7 +424,7 @@ static int probe_cache__open(struct probe_cache *pcache, const char *target,
 
        if (target && build_id_cache__cached(target)) {
                /* This is a cached buildid */
-               strncpy(sbuildid, target, SBUILD_ID_SIZE);
+               strlcpy(sbuildid, target, SBUILD_ID_SIZE);
                dir_name = build_id_cache__linkname(sbuildid, NULL, 0);
                goto found;
        }