pglz_decompress() - Mailing list pgsql-hackers

From Hadi Moshayedi
Subject pglz_decompress()
Date
Msg-id CAK=1=WqC2+=vHFrsPPwKV+-k+EKNi+V2UPSEHwzn4oeguLLyng@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hello,

The comments in pg_lzcompress.c say that:

 * If VARSIZE(x) == rawsize + sizeof(PGLZ_Header), then the data
 * is stored uncompressed as plain bytes. Thus, the decompressor
 * simply copies rawsize bytes from the location after the
 * header to the destination.

But pg_lzdecompress doesn't seem to check explicitly for the VARSIZE(x) == rawsize + sizeof(PGLZ_Header) condition. Is it caller's responsibility to check for this condition before calling pg_lzdecompress(), or does it happen somehow in pg_lzdecompress()?

Thanks,
  -- Hadi

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: jsonb and nested hstore
Next
From: David Fetter
Date:
Subject: Re: [pgsql-advocacy] GSoC 2014 - mentors, students and admins