Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 31085 invoked from network); 13 Aug 2009 17:23:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Aug 2009 17:23:31 -0000 Received: (qmail 41322 invoked by uid 500); 13 Aug 2009 17:23:37 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 41285 invoked by uid 500); 13 Aug 2009 17:23:37 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 41276 invoked by uid 99); 13 Aug 2009 17:23:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 17:23:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2009 17:23:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7A5EF234C004 for ; Thu, 13 Aug 2009 10:23:15 -0700 (PDT) Message-ID: <2142609778.1250184195486.JavaMail.jira@brutus> Date: Thu, 13 Aug 2009 10:23:15 -0700 (PDT) From: "Murph McCloy (JIRA)" To: axis-c-dev@ws.apache.org Subject: [jira] Created: (AXIS2C-1387) apache2_stream_read function ignores errors from ap_get_client_block is size_t is unsigned MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org apache2_stream_read function ignores errors from ap_get_client_block is size_t is unsigned ------------------------------------------------------------------------------------------ Key: AXIS2C-1387 URL: https://issues.apache.org/jira/browse/AXIS2C-1387 Project: Axis2-C Issue Type: Bug Components: build system (Unix/Linux) Affects Versions: 1.6.0 Environment: CentOS 5.3 httpd-2.2.3 rampartc-1.3.0 dell precision desktop Reporter: Murph McCloy Priority: Minor This problem has only been noticed when attempting to decompress input streams via apache. The problem occurs when a decompression payload fails to decompress properly. In my test case it was because the payload had some flags set in the gzip headers and mod_deflate doesn't support flags. mod_deflate then returned an APR_EGENERAL error message. This message then bubbled up and was returned as a -1 to apache2_stream_read. This is a problem because size_t, on my system, is unsigned. The checks in apache2_stream_read fail to catch a negative value in this scenario and dont respond appropriately. while (count - len > 0) { read = ap_get_client_block(stream_impl->request, (char *)buffer + len, count - len); if (read > 0) { len += read; } else { break; } } The else statement will never get reached while read is unsigned. Also, the while loop might have troubles as well. I would suggest modifying read and len to be ssize_t so they match the return value of ap_get_client_block. If I get this modified and working, I will submit a patch. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.