Return-Path: Delivered-To: apmail-apache-bugdb-archive@apache.org Received: (qmail 99677 invoked by uid 500); 31 Mar 2001 19:50:01 -0000 Mailing-List: contact apache-bugdb-help@apache.org; run by ezmlm Precedence: bulk Reply-To: apache-bugdb@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-bugdb@apache.org Received: (qmail 99657 invoked by uid 501); 31 Mar 2001 19:50:00 -0000 Resent-Date: 31 Mar 2001 19:50:00 -0000 Resent-Message-ID: <20010331195000.99656.qmail@apache.org> Resent-From: submit@bugz.apache.org (GNATS Filer) Resent-To: apache-bugdb@apache.org Resent-Cc: apache-bugdb@apache.org Resent-Reply-To: submit@bugz.apache.org, ache@nagual.pp.ru Received: (qmail 99213 invoked by uid 501); 31 Mar 2001 19:47:19 -0000 Message-Id: <20010331194719.99212.qmail@apache.org> Date: 31 Mar 2001 19:47:19 -0000 From: Andrey Chernov Reply-To: ache@nagual.pp.ru To: submit@bugz.apache.org X-Send-Pr-Version: 3.110 Subject: general/7495: Wrong cast used to obtain index from a char >Number: 7495 >Category: general >Synopsis: Wrong cast used to obtain index from a char >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Sat Mar 31 11:50:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: ache@nagual.pp.ru >Release: 1.3.19 >Organization: apache >Environment: Any signed char C compiler. >Description: This line from util.c #define TEST_CHAR(c, f) (test_char_table[(unsigned)(c)] & (f)) use wrong cast which make index worse by another way: 8bit chars become too big (consider 0xFFFFFFFF from '\377' char) instead of negative. Proper cast is (unsigned char) not just (unsigned)! Plain (unsigned) cast promote to int first, i.e. makes -1 from '\377' and then convert -1 to 0xFFFFFFFF. >How-To-Repeat: >Fix: Use (unsigned char) cast instead of just (unsigned) >Release-Note: >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, you need] [to include in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]