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

Commit6a3dcd2

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 parent52b70b1 commit6a3dcd2

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
@@ -2218,10 +2218,12 @@ load_hba(void)
22182218
/*
22192219
* This macro specifies the maximum number of authentication options
22202220
* that are possible with any given authentication method that is supported.
2221-
* Currently LDAP supports 10, so the macro value is well above the most any
2222-
* method needs.
2221+
* Currently LDAP supports 11, and there are 3 that are not dependent on
2222+
* the auth method here. It may not actually be possible to set all of them
2223+
* at the same time, but we'll set the macro value high enough to be
2224+
* conservative and avoid warnings from static analysis tools.
22232225
*/
2224-
#defineMAX_HBA_OPTIONS12
2226+
#defineMAX_HBA_OPTIONS14
22252227

22262228
/*
22272229
* Create a text array listing the options specified in the HBA line.
@@ -2327,6 +2329,7 @@ gethba_options(HbaLine *hba)
23272329
CStringGetTextDatum(psprintf("radiusports=%s",hba->radiusports_s));
23282330
}
23292331

2332+
/* If you add more options, consider increasing MAX_HBA_OPTIONS. */
23302333
Assert(noptions <=MAX_HBA_OPTIONS);
23312334

23322335
if (noptions>0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp