From: k@... Date: 2016-12-14T12:20:11+00:00 Subject: [ruby-core:78646] [Ruby trunk Bug#13034] rb_enc_ascget() does not handle 'needmore' error from rb_enc_procise_mbclen() Issue #13034 has been reported by Kazuki Yamaguchi. ---------------------------------------- Bug #13034: rb_enc_ascget() does not handle 'needmore' error from rb_enc_procise_mbclen() https://bugs.ruby-lang.org/issues/13034 * Author: Kazuki Yamaguchi * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.1: UNKNOWN, 2.2: REQUIRED, 2.3: REQUIRED ---------------------------------------- rb_enc_ascget() stores the return value from rb_enc_procise_mbclen() that may return a negative value on error to 'unsigned int', and thus it overlooks errors due to incomplete UTF-16/32 byte sequence. This bug is visible from Ruby; for example, the following code gets stuck in infinite loop: ~~~ str = "\x00".force_encoding("UTF-16BE") Regexp.quote(str) # Ruby freezes ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: