From b86432c29e63e61bbdeb110135101cdec7cfdb86 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Wed, 23 Oct 2024 21:52:22 -0600 Subject: [PATCH] Fix buggy sizeof A sizeof on a pointer on a 64 bit machine is 8 bytes whereas Entry::old_name is a 64 byte array of characters. There was most likely no fallout since the string would start with NUL bytes, but best to fix nonetheless. Signed-off-by: Tristan Partin --- pgxn/neon/control_plane_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgxn/neon/control_plane_connector.c b/pgxn/neon/control_plane_connector.c index 0730c305cb..4713103909 100644 --- a/pgxn/neon/control_plane_connector.c +++ b/pgxn/neon/control_plane_connector.c @@ -767,7 +767,7 @@ HandleDropRole(DropRoleStmt *stmt) entry->type = Op_Delete; entry->password = NULL; if (!found) - memset(entry->old_name, 0, sizeof(entry)); + memset(entry->old_name, 0, sizeof(entry->old_name)); } }