mirror of
https://github.com/postgres/postgres.git
synced 2026-04-21 06:08:26 -04:00
Zero-fill private_data when attaching an injection point
InjectionPointAttach() did not initialize the private_data buffer of the shared memory entry before (perhaps partially) overwriting it. When the private data is set to NULL by the caler, the buffer was left uninitialized. If set, it could have stale contents. The buffer is initialized to zero, so as the contents recorded when a point is attached are deterministic. Author: Sami Imseih <samimseih@gmail.com> Discussion: https://postgr.es/m/CAA5RZ0tsGHu2h6YLnVu4HiK05q+gTE_9WVUAqihW2LSscAYS-g@mail.gmail.com Backpatch-through: 17
This commit is contained in:
parent
71ff232a5b
commit
5b5bf51e43
1 changed files with 1 additions and 0 deletions
|
|
@ -322,6 +322,7 @@ InjectionPointAttach(const char *name,
|
|||
strlcpy(entry->name, name, sizeof(entry->name));
|
||||
strlcpy(entry->library, library, sizeof(entry->library));
|
||||
strlcpy(entry->function, function, sizeof(entry->function));
|
||||
memset(entry->private_data, 0, INJ_PRIVATE_MAXLEN);
|
||||
if (private_data != NULL)
|
||||
memcpy(entry->private_data, private_data, private_data_size);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue