soltools/cpp/_lex.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 22c1d6972b4dbf2a3394a28cacfb27cf5bdbb659
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Thu Oct 4 10:27:54 2018 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Thu Oct 4 14:23:16 2018 +0200

    Avoid -Werror=stringop-truncation
    
    ... "‘strncpy’ output truncated before terminating nul copying as many bytes
    from a string as its length", as reported at
    
<https://lists.freedesktop.org/archives/libreoffice/2018-October/081109.html>
    "LO build fails -Werror=stringop-truncation in _lex.c".  Not adding the
    terminating NUL appears to be intentional here, as the s->inp buffer is
    terminated (through s->inl) with EOB bytes after the if/else blocks.
    
    Change-Id: I5a8559e620b7e34ee27cbcd0f836432deb8cba90
    Reviewed-on: https://gerrit.libreoffice.org/61355
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c
index 3fa180b040a4..70c808b87187 100644
--- a/soltools/cpp/_lex.c
+++ b/soltools/cpp/_lex.c
@@ -668,7 +668,7 @@ Source *
         len = strlen(str);
         s->inb = domalloc(len + 4);
         s->inp = s->inb;
-        strncpy((char *) s->inp, str, len);
+        memcpy((char *) s->inp, str, len);
     }
     else
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to