pgsql: Fix type confusion in guc_var_compare()

Started by Andres Freundabout 2 years ago1 messagescomitters
Jump to latest
#1Andres Freund
andres@anarazel.de

Fix type confusion in guc_var_compare()

Before this change guc_var_compare() cast the input arguments to
const struct config_generic *. That's not quite right however, as the input
on one side is often just a char * on one side.

Instead just use char *, the first field in config_generic.

This fixes a -Warray-bounds warning with some versions of gcc. While the
warning is only known to be triggered for <= 15, the issue the warning points
out seems real, so apply the fix everywhere.

Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reported-by: Erik Rijkers <er@xs4all.nl>
Suggested-by: Andres Freund <andres@anarazel.de>
Discussion: /messages/by-id/a74a1a0d-0fd2-3649-5224-4f754e8f91aa@xs4all.nl

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ee89c4fa4b184bd2cc2a2b48fc13f474e6aa2a24

Modified Files
--------------
src/backend/utils/misc/guc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)