From dev-return-59348-archive-asf-public=cust-asf.ponee.io@thrift.apache.org Sun Oct 11 01:38:03 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 141DE18063B for ; Sun, 11 Oct 2020 03:38:03 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 50E524340B for ; Sun, 11 Oct 2020 01:38:02 +0000 (UTC) Received: (qmail 59507 invoked by uid 500); 11 Oct 2020 01:38:01 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 59494 invoked by uid 99); 11 Oct 2020 01:38:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Oct 2020 01:38:01 +0000 Received: from jira2-he-de.apache.org (static.54.33.119.168.clients.your-server.de [168.119.33.54]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E1AAA428BD for ; Sun, 11 Oct 2020 01:38:00 +0000 (UTC) Received: from jira2-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira2-he-de.apache.org (ASF Mail Server at jira2-he-de.apache.org) with ESMTP id 3BA91C8014B for ; Sun, 11 Oct 2020 01:38:00 +0000 (UTC) Date: Sun, 11 Oct 2020 01:38:00 +0000 (UTC) From: "Yuxuan Wang (Jira)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (THRIFT-5294) Go: TSimpleJSONProtocol could panic on WriteMessageEnd without matching WriteMessageBegin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Yuxuan Wang created THRIFT-5294: ----------------------------------- Summary: Go: TSimpleJSONProtocol could panic on WriteMessageEnd without matching WriteMessageBegin Key: THRIFT-5294 URL: https://issues.apache.org/jira/browse/THRIFT-5294 Project: Thrift Issue Type: Task Components: Go - Library Affects Versions: 0.13.0 Reporter: Yuxuan Wang Assignee: Yuxuan Wang I noticed the issue while writing the example loggingMiddleware code in https://github.com/apache/thrift/pull/1992#issuecomment-705903922. The root cause is that we have two context stacks when implementing TSimpleJSONProtocol in go library, but we never check the slice length before the popping/peeking operations, and in certain circumstances (e.g. calling WriteMessageEnd without matching WriteMessageBegin) it would panic with using -1 as the slice index. It should return an TProtocolException instead. -- This message was sent by Atlassian Jira (v8.3.4#803005)