summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxhe <xw897002528@gmail.com>2018-12-16 15:42:25 +0800
committerrofl0r <retnyg@gmx.net>2019-01-16 02:38:18 +0000
commitf65b4e0161fe87bd6ddcb9c633c7b7bf52584c0a (patch)
treec562d4c2f97058fb2fa83b0a1b12ceebd693cfc4
parentb5136fecf3d73b072b622f2102af6d38cd2b5e07 (diff)
downloadgettext-tiny-f65b4e0161fe87bd6ddcb9c633c7b7bf52584c0a.tar.gz
poparser: return if the buf is too small
if line_len, e.g. inputbytes_left is not 0, that means the output buf is large enough.
-rw-r--r--src/poparser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/poparser.c b/src/poparser.c
index e71e386..874e835 100644
--- a/src/poparser.c
+++ b/src/poparser.c
@@ -165,6 +165,9 @@ enum po_error poparser_feed_line(struct po_parser *p, char* in, size_t in_len) {
if ( (len = iconv(p->cd, &line, &line_len, &x, &len)) == (size_t)-1)
return -po_failed_iconv;
+ if (line_len != 0)
+ return -po_failed_iconv;
+
x = p->buf;
}
@@ -225,6 +228,9 @@ enum po_error poparser_feed_line(struct po_parser *p, char* in, size_t in_len) {
if ( (len = iconv(p->cd, &line, &line_len, &x, &len)) == (size_t)-1)
return -po_failed_iconv;
+ if (line_len != 0)
+ return -po_failed_iconv;
+
x = p->buf;
}