Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5574a01

Browse files
committed
Fix possible buffer overrun in hba.c.
Coverty reports a possible buffer overrun in the code that populates thepg_hba_file_rules view. It may not be a live bug due to restrictionson options that can be used together, but let's increase MAX_HBA_OPTIONSand correct a nearby misleading comment.Back-patch to 10 where this code arrived.Reported-by: Julian HsiaoDiscussion:https://postgr.es/m/CADnGQpzbkWdKS2YHNifwAvX5VEsJ5gW49U4o-7UL5pzyTv4vTg%40mail.gmail.com
1 parentc6b3835 commit5574a01

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/backend/libpq/hba.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,10 +2188,12 @@ load_hba(void)
21882188
/*
21892189
* This macro specifies the maximum number of authentication options
21902190
* that are possible with any given authentication method that is supported.
2191-
* Currently LDAP supports 10, so the macro value is well above the most any
2192-
* method needs.
2191+
* Currently LDAP supports 10, and there are 3 that are not dependent on
2192+
* the auth method here. It may not actually be possible to set all of them
2193+
* at the same time, but we'll set the macro value high enough to be
2194+
* conservative and avoid warnings from static analysis tools.
21932195
*/
2194-
#defineMAX_HBA_OPTIONS12
2196+
#defineMAX_HBA_OPTIONS13
21952197

21962198
/*
21972199
* Create a text array listing the options specified in the HBA line.
@@ -2292,6 +2294,7 @@ gethba_options(HbaLine *hba)
22922294
CStringGetTextDatum(psprintf("radiusports=%s",hba->radiusports_s));
22932295
}
22942296

2297+
/* If you add more options, consider increasing MAX_HBA_OPTIONS. */
22952298
Assert(noptions <=MAX_HBA_OPTIONS);
22962299

22972300
if (noptions>0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp