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=-2.2 required=3.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_PASS, T_DKIM_INVALID,T_RP_MATCHES_RCVD shortcircuit=no autolearn=no 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 A79E71FACB for ; Wed, 7 Jun 2017 13:02:26 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B15B2120719; Wed, 7 Jun 2017 22:02:25 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 4EDC512068F for ; Wed, 7 Jun 2017 22:02:24 +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=mwylRH+tEINihtrb7eetdtZVqEU=; b=y/JAgW0fukSe12yQln dyWwg7nB+YOANtm41OHUtd5urC+5wV5S9Tvvvv3/8BMVyhhPoa7TCLDiYy290dmJ meSD0EtBymN2q3dj11cS6r8MlA+X3+FqliomO1U3oWTg4PvQ3LrwXmhAmOCIJ8YW AuT5GCSfDrs+7612ebGioPydI= Received: by filter0505p1mdw1.sendgrid.net with SMTP id filter0505p1mdw1-15432-5937F953-4 2017-06-07 13:02:11.049622174 +0000 UTC Received: from herokuapp.com (ec2-54-144-225-246.compute-1.amazonaws.com [54.144.225.246]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id oM4of-GdRz6VUaTR9M68qQ for ; Wed, 07 Jun 2017 13:02:11.085 +0000 (UTC) Date: Wed, 07 Jun 2017 13:02:10 +0000 From: kou@cozmixng.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56633 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13636 X-Redmine-Issue-Author: fanantoxa X-Redmine-Issue-Assignee: kou X-Redmine-Sender: kou 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS6zFvD/ePQAeaGIk1NRtqvguZwrbhOJXhA/FJ EL7AGauSTpNtpZmpoLCHBQYJUgrLaN5vN5Rtd5X+oTQYwKsT/WdU1MpC6Kin8UOBeqDpyQXAmr9SGu lBimMiVLvcgQbhmWm53F1Hpb0oLS2795sGYP X-ML-Name: ruby-core X-Mail-Count: 81606 Subject: [ruby-core:81606] [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 updated by kou (Kouhei Sutou). Thanks for your report. I've added a validation on end of document. ---------------------------------------- Bug #13636: REXML::Document.parse_stream doesn't handle when closing tag not provided https://bugs.ruby-lang.org/issues/13636#change-65304 * Author: fanantoxa (Anton Sivakov) * Status: Closed * Priority: Normal * Assignee: kou (Kouhei Sutou) * Target version: 2.5 * 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/