Re: pg_verifybackup: TAR format backup verification
От | Tom Lane |
---|---|
Тема | Re: pg_verifybackup: TAR format backup verification |
Дата | |
Msg-id | 1636825.1727733956@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: pg_verifybackup: TAR format backup verification (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: pg_verifybackup: TAR format backup verification
|
Список | pgsql-hackers |
Robert Haas <robertmhaas@gmail.com> writes: > On Mon, Sep 30, 2024 at 11:31 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> WFM, modulo the suggestion about changing data types. > I would prefer not to make the data type change here because it has > quite a few tentacles. I see your point for the function's "len" argument, but perhaps it's worth doing - int remaining; + size_t remaining; remaining = sizeof(ControlFileData) - mystreamer->control_file_bytes; memcpy(((char *) &mystreamer->control_file) + mystreamer->control_file_bytes, - data, Min(len, remaining)); + data, Min((size_t) len, remaining)); This is enough to ensure the Min() remains safe. regards, tom lane
В списке pgsql-hackers по дате отправления: