Fix array access overrun pointed out by Coverity.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 18 Apr 2020 03:50:47 +0000 (12:50 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 18 Apr 2020 03:50:47 +0000 (12:50 +0900)
src/main/pgpool_main.c

index eefab0bbe0c9ec399890cebf67500654446da402..38b582281c41904d2ef58bb88771e98b75e7a2bc 100644 (file)
@@ -4522,7 +4522,7 @@ set_application_name_with_suffix(ProcessType ptype, int suffix)
 {
        char    *appname_buf;
 
-       if (ptype < 0 || ptype > PT_LAST_PTYPE)
+       if (ptype < 0 || ptype >= PT_LAST_PTYPE)
        {
                ereport(ERROR,
                                (errmsg("failed to set application name. process type: %d", ptype)));