gallium/utils: silence strncpy warning
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 16 Apr 2020 08:24:24 +0000 (10:24 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 21 Apr 2020 07:16:26 +0000 (09:16 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4584>

src/gallium/auxiliary/util/u_debug_symbol.c

index f576a51fe990956565cddcbd556c4fb4c77a1c4e..334803d008ee67fa2e6dd59db8cafd0325a75098 100644 (file)
@@ -234,7 +234,7 @@ debug_symbol_name_glibc(const void *addr, char* buf, unsigned size)
    if (!syms) {
       return FALSE;
    }
-   strncpy(buf, syms[0], size);
+   strncpy(buf, syms[0], size - 1);
    buf[size - 1] = 0;
    free(syms);
    return TRUE;