BUG #13688: lack of return value in r_mark_regions()

From: rucsoftsec(at)163(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #13688: lack of return value in r_mark_regions()
Date: 2015-10-19 14:57:58
Message-ID: 20151019145758.3021.94507@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 13688
Logged by: Zhang Yan
Email address: rucsoftsec(at)163(dot)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 }

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2015-10-19 15:12:48 Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp
Previous Message Степан Перлов 2015-10-19 14:42:44 Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp