Skip to content

Commit cb671fe

Browse files
zhangwenchao-123my-ship-it
authored andcommitted
Fix some compilation and habitual thinking errors.
Fix a variable used uninitialized compilation error and an always true judgement in authorization. Authored-by: Zhang Wenchao [email protected]
1 parent 20cbc1d commit cb671fe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/backend/commands/tag.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ AddTagDescriptions(List *tags,
471471
bool isnull;
472472
bool has_matching_allowed_val;
473473
List *allowed_values;
474-
ListCell *value_cell;
474+
ListCell *value_cell = NULL;
475475

476476
has_matching_allowed_val = false;
477477
def = lfirst(cell);
@@ -871,7 +871,7 @@ transformTagValues(int action, Oid tagId, Datum oldvalues,
871871
List *allowed_values, bool unset)
872872
{
873873
List *resultValues = untransformTagValues(oldvalues);
874-
ListCell *value_cell;
874+
ListCell *value_cell = NULL;
875875
Datum result;
876876

877877
Assert(!(resultValues && unset));

src/backend/libpq/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ auth_failed(Port *port, int status, char *logdetail)
395395
account_status = DatumGetInt16(SysCacheGetAttr(AUTHNAME, auth_tuple,
396396
Anum_pg_authid_rolaccountstatus, &account_status_isnull));
397397
if (enable_password_profile && !authform->rolsuper && authform->rolenableprofile &&
398-
(account_status != ROLE_ACCOUNT_STATUS_LOCKED ||
398+
(account_status != ROLE_ACCOUNT_STATUS_LOCKED &&
399399
account_status != ROLE_ACCOUNT_STATUS_LOCKED_TIMED))
400400
SendLoginFailedSignal(port->user_name);
401401

0 commit comments

Comments
 (0)