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

Commita5ffa8f

Browse files
committed
Guard against bug in Solaris' bsearch(), per Michael Wildpaner.
1 parenta5a6876 commita5ffa8f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/backend/libpq/hba.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.117 2003/11/29 19:51:49 pgsql Exp $
13+
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.118 2003/12/05 15:50:31 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -381,6 +381,10 @@ user_group_bsearch_cmp(const void *user, const void *list)
381381
staticList**
382382
get_group_line(constchar*group)
383383
{
384+
/* On some versions of Solaris, bsearch of zero items dumps core */
385+
if (group_length==0)
386+
returnNULL;
387+
384388
return (List**)bsearch((void*)group,
385389
(void*)group_sorted,
386390
group_length,
@@ -392,9 +396,13 @@ get_group_line(const char *group)
392396
/*
393397
* Lookup a user name in the pg_shadow file
394398
*/
395-
List**
399+
List**
396400
get_user_line(constchar*user)
397401
{
402+
/* On some versions of Solaris, bsearch of zero items dumps core */
403+
if (user_length==0)
404+
returnNULL;
405+
398406
return (List**)bsearch((void*)user,
399407
(void*)user_sorted,
400408
user_length,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp