Improving LZXpress decompression/compression algorithms

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Fri Apr 2 01:06:31 UTC 2021


On 1/04/21 9:13 pm, Matt Suiche via samba-technical wrote:
> First of all, thanks a lot to Douglas Bagnall for the assistance.
> 
> While I was revisiting the LZXpress implementation, I discovered that the 2
> official documented cases from MS-XCA were not supported:
> https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-xca/72da4f8d-2ba3-437d-b772-2e4173713a0b?redirectedfrom=MSDN
> 
> The attached implementation includes bug fixes in the decompression
> algorithm, a rewrite of the compression function and additional tests as it
> only had a single test.
> 

I have created a merge request from these patches:

https://gitlab.com/samba-team/samba/-/merge_requests/1882

Two things:

1. Patch 1/2 lacks the Signed-off-by.

2. The build fails on this line:

 ../../lib/compression/lzxpress.c:356:4: error: for loop initial
declarations are only allowed in C99 mode
     for (int i = 0; i < length; i++) {
     ^
Our style is to declare `int i;` (or likely better, `size_t i;`) at the
top of the function.

(Interestingly it is only the Centos 7 compile that failed on this).

I will attempt a full review after easter.

cheers,
Douglas



More information about the samba-technical mailing list