Mesa (master): gallium/utils: silence strncpy warning

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 21 07:37:29 UTC 2020


Module: Mesa
Branch: master
Commit: 07071cac7b97b20ba3b5a633171af7ac8ac09d00
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=07071cac7b97b20ba3b5a633171af7ac8ac09d00

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Thu Apr 16 10:24:24 2020 +0200

gallium/utils: silence strncpy warning

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4584>

---

 src/gallium/auxiliary/util/u_debug_symbol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c
index f576a51fe99..334803d008e 100644
--- a/src/gallium/auxiliary/util/u_debug_symbol.c
+++ b/src/gallium/auxiliary/util/u_debug_symbol.c
@@ -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;



More information about the mesa-commit mailing list