projects
/
pgpool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb7e3f5
)
Fix to check the return value of strchr() in Pgversion().
author
Tatsuo Ishii
<ishii@sraoss.co.jp>
Sat, 6 Jul 2019 23:24:16 +0000
(08:24 +0900)
committer
Tatsuo Ishii
<ishii@sraoss.co.jp>
Sat, 6 Jul 2019 23:24:16 +0000
(08:24 +0900)
Pointed out by Coverity.
src/protocol/child.c
patch
|
blob
|
blame
|
history
diff --git
a/src/protocol/child.c
b/src/protocol/child.c
index 6d49c2c709e31492f452e0999ba4d279333f7c8c..ecc797b884aef9845f5d011c5a483c951f6d98df 100644
(file)
--- a/
src/protocol/child.c
+++ b/
src/protocol/child.c
@@
-2538,6
+2538,13
@@
Pgversion(POOL_CONNECTION_POOL * backend)
* valid digit (in our case 'b')). So "12beta1" should be converted to 12.
*/
p = strchr(result, ' ');
+ if (p == NULL)
+ {
+ ereport(FATAL,
+ (errmsg("Pgversion: unable to find the first space in the version string: %s", result)));
+ return NULL;
+ }
+
p++;
i = 0;
while (i < VERSION_BUF_SIZE - 1 && p && *p != '.')