commit 9ed8a3069be5da98cfcf0bc78bf11172ecf7c700
Author: Kornel Benko <[email protected]>
Date:   Fri Jun 27 21:18:17 2025 +0200

    Amend 9d527385: Memory overlap
    
    Using memmove instead of memcpy
    Thanks Enrico.
---
 src/support/gzstream.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/support/gzstream.cpp b/src/support/gzstream.cpp
index f6083211f7..71bd729b3a 100644
--- a/src/support/gzstream.cpp
+++ b/src/support/gzstream.cpp
@@ -92,9 +92,7 @@ int gzstreambuf::underflow() { // used for input buffer only
     int n_putback = gptr() - eback();
     if ( n_putback > 4)
         n_putback = 4;
-    char tmp[5];
-    memcpy(tmp, gptr() - n_putback, n_putback);
-    memcpy( buffer + (4 - n_putback), tmp, n_putback);
+    memmove( buffer + (4 - n_putback), gptr() - n_putback, n_putback);
 
     int num = gzread( file, buffer+4, bufferSize-4);
     if (num <= 0) // ERROR or EOF
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to