Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZoC9S-00033v-SV for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Oct 2015 15:15:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZoC9S-0002Bs-EM for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Oct 2015 15:15:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZoBt2-0003Va-W7 for pgsql-bugs@postgresql.org; Mon, 19 Oct 2015 14:58:09 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZoBsw-0006fo-FS for pgsql-bugs@postgresql.org; Mon, 19 Oct 2015 14:58:08 +0000 MIME-Version: 1.0 Subject: BUG #13688: lack of return value in r_mark_regions() To: pgsql-bugs@postgresql.org From: rucsoftsec@163.com Date: Mon, 19 Oct 2015 14:57:58 +0000 Message-ID: <20151019145758.3021.94507@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 13688 Logged by: Zhang Yan Email address: rucsoftsec@163.com PostgreSQL version: 9.4.5 Operating system: Linux Mint 15 Description: For each execuation result of function r_mark_regions(), it always return 1. the related code snippets in r_mark_regions() are as following. 354 static int r_mark_regions(struct SN_env * z) { 355 z->I[0] = z->l; 356 z->I[1] = z->l; 357 { int c1 = z->c; /* do, line 63 */ 358 { /* gopast */ /* grouping v, line 64 */ 359 int ret = out_grouping(z, g_v, 192, 220, 1); 360 if (ret < 0) goto lab0; 361 z->c += ret; 362 } 363 z->I[0] = z->c; /* setmark pV, line 64 */ 364 { /* gopast */ /* non v, line 64 */ 365 int ret = in_grouping(z, g_v, 192, 220, 1); 366 if (ret < 0) goto lab0; 367 z->c += ret; 368 } 369 { /* gopast */ /* grouping v, line 65 */ 370 int ret = out_grouping(z, g_v, 192, 220, 1); 371 if (ret < 0) goto lab0; 372 z->c += ret; 373 } 374 { /* gopast */ /* non v, line 65 */ 375 int ret = in_grouping(z, g_v, 192, 220, 1); 376 if (ret < 0) goto lab0; 377 z->c += ret; 378 } 379 z->I[1] = z->c; /* setmark p2, line 65 */ 380 lab0: 381 z->c = c1; 382 } 383 return 1; 384 } However, in its caller function, the return value of function r_mark_regions() should have two possibilities at least. So, there lack of return value in r_mark_regions(). The related code snippets in russian_KOI8_R_stem() are as following. 604 extern int russian_KOI8_R_stem(struct SN_env * z) { 605 { int c1 = z->c; /* do, line 203 */ 606 { int ret = r_mark_regions(z); 607 if (ret == 0) goto lab0; /* call mark_regions, line 203 */ 608 if (ret < 0) return ret; 609 } 610 lab0: 611 z->c = c1; 612 } ...... 693 z->c = z->lb; 694 return 1; 695 } -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs