> On Sep 29, 2021, at 9:01 AM, Christoph Berg wrote:
>
> Re: Richard Yen
>> Ah, thanks for the tip. That's right -- I can't assume the user's input is
>> a valid file. Updated patch here.
>
> Hi Richard,
>
> sorry for the very late response here.
>
> Thanks for the patch which I just merg
Re: Richard Yen
> Ah, thanks for the tip. That's right -- I can't assume the user's input is
> a valid file. Updated patch here.
Hi Richard,
sorry for the very late response here.
Thanks for the patch which I just merged, and thanks Justin for the
reviews!
Christoph
On Thu, Apr 29, 2021 at 12:05 PM Justin Pryzby wrote:
> I think you should be able to avoid crashing if passed a non-relmapper
> file.
> Make sure not to loop over more mappings than exist in the relmapper file
> of
> the given size.
>
> I guess you should warn if the number of mappings is too la
I think you should be able to avoid crashing if passed a non-relmapper file.
Make sure not to loop over more mappings than exist in the relmapper file of
the given size.
I guess you should warn if the number of mappings is too large for the file's
size. And then "cap" the number of mappings to th
Thanks for the feedback, Justin. I've gone ahead and switched to use
memcmp. I also refactored it to:
1. Don't assume that any file with first 4 bytes matching the
relmapper magic number is a pg_relnode.map file
2. Don't assume the pg_relnode.map file is uncorrupted and intact; perform
a check o
This is separate from the postgresql server repo.
https://git.postgresql.org/gitweb/?p=pg_filedump.git
+#define RELMAPPER_FILEMAGIC 0x592717
+char magic_buffer[8];
...
+ if ( (int) magic_buffer & RELMAPPER_FILEMAGIC ) {
This is doing bitwise arithmetic on a pointer, which seems badly wrong.