gzstream: memmove is safer here

Thanks to @fosnola for spotting this.
This commit is contained in:
2023-01-21 11:01:41 -05:00
parent 0e77f56fbb
commit 641bef9f80

View File

@@ -85,7 +85,7 @@ int gzstreambuf::underflow() { // used for input buffer only
int n_putback = gptr() - eback();
if( n_putback > 4)
n_putback = 4;
memcpy( buffer + (4 - n_putback), gptr() - n_putback, 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