From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id E0685209FD for ; Tue, 6 Jun 2017 21:35:58 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id D00EF120719; Wed, 7 Jun 2017 06:35:55 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 6C81A12068F for ; Wed, 7 Jun 2017 06:35:44 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=ALeBnmkmEdGOt9jSooaiQipm7Tc=; b=sGTvge3XOsfZyDi5Ug sO4BzEo6rxQ0VwPZn7iq1AsCcu/TPKN04e+aUtb5oN7Ns9SDugT+T5RHHML6ibaG LecckaS2D4EZni7r5BTo9iyXRo7CutrCW5OEc7EMebMtLpLFgty3lMInslIW5Ud/ NNpBsOtXo+wf+xNrWIc2FM6rY= Received: by filter0462p1mdw1.sendgrid.net with SMTP id filter0462p1mdw1-29126-5937202C-7 2017-06-06 21:35:40.099526991 +0000 UTC Received: from herokuapp.com (ec2-54-162-219-243.compute-1.amazonaws.com [54.162.219.243]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id aglErfGmR5KP19P0u-IB7Q for ; Tue, 06 Jun 2017 21:35:40.164 +0000 (UTC) Date: Tue, 06 Jun 2017 21:35:39 +0000 From: fanantoxa@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56622 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13636 X-Redmine-Issue-Author: fanantoxa X-Redmine-Sender: fanantoxa X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5rvMbyZuP1thA4NEZLauVyRemF+950jXKzTG QT8FyL+HopgKGbYCdY2VwqsZIJOmwHk55FNdEje+JjD+G5bP75PlzpRV54wonC+XJHpxb+DpajGybm ZvVeeqGAQ4exPgWNDxmbX8NFpxfXbSbujRNz+lbEyveNnZAGtrcpuuZrGw== X-ML-Name: ruby-core X-Mail-Count: 81593 Subject: [ruby-core:81593] [Ruby trunk Bug#13636] REXML::Document.parse_stream doesn't handle when closing tag not provided X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13636 has been reported by fanantoxa (Anton Sivakov). ---------------------------------------- Bug #13636: REXML::Document.parse_stream doesn't handle when closing tag not provided https://bugs.ruby-lang.org/issues/13636 * Author: fanantoxa (Anton Sivakov) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- I've tried to use REXML for parsing but got unexpected behavior: Here is example: ~~~ ruby require 'rexml/document' require 'rexml/streamlistener' class Handler include REXML::StreamListener end xml1 = StringIO.new("test") xml2 = StringIO.new("test") xml3 = StringIO.new("test") handler = Handler.new REXML::Document.parse_stream(xml1, handler) # => nil REXML::Document.parse_stream(xml2, handler) # => REXML::ParseException: Missing end tag for 'item' (got "body") REXML::Document.parse_stream(xml3, handler) # => nil ~~~ Actualy XML: "test" is broken so it's expected to get: ~~~ ruby REXML::ParseException.new( "Missing end tag for body") ~~~ I can't rely on REXML parse since I'm not getting exception when XML data structure not valid. -- https://bugs.ruby-lang.org/