pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rucsoftsec@163.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13688: lack of return value in r_mark_regions()
Date: Mon, 19 Oct 2015 14:57:58 +0000
Message-ID: <20151019145758.3021.94507@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (5+ messages)  latest in thread

Message-ID: <20151019145758.3021.94507@wrigleys.postgresql.org>
Permalink:  ../20151019145758.3021.94507@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20151019145758.3021.94507@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: rucsoftsec@163.com
  Subject: Re: BUG #13688: lack of return value in r_mark_regions()
  In-Reply-To: <20151019145758.3021.94507@wrigleys.postgresql.org>
  References: <20151019145758.3021.94507@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox