You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ha...@hyperreal.com> on 1995/12/09 22:15:39 UTC

WWW Form Bug Report: "buggy perl code in dbmmanage.new - randomchar" on BSDI (fwd)

no ack sent.

Brian, is this yours?

Forwarded message:
> From nobody@hyperreal.com  Fri Dec  8 19:38:16 1995
> Message-Id: <19...@taz.hyperreal.com>
> From: nat@vivid.com
> To: apache-bugs%apache.org@organic.com
> Date: Fri Dec  8 19:38:14 1995
> Subject: WWW Form Bug Report: "buggy perl code in dbmmanage.new - randomchar" on BSDI
> 
> Submitter: nat@vivid.com
> Operating system: BSDI, version: 
> Extra Modules used: 
> URL exhibiting problem: 
> 
> Symptoms:
> --
> The "experimental" perl support script 
> dbmmanage.new has a minor bug in it, in
> the randomchar subroutine.
> 
> A 64 character string is being referenced by:
> 
> $str .= substr($enc,int(rand(64))+1,1);
> 
> which generates a number from 1 to 64, when 
> actually we want a number from 0 to 63.  
> 
> This very minor bug causes the function to 
> sometimes (1 in 64 times approximately) return 
> null instead of a random character, and never 
> return '.', which is the first string element.
> 
> the line to fix this is:
> $str .= substr($enc,int(rand(64)),1);
> 
> Like I said, very minor, but I thought 
> I'd mention it.
> 
> Hope this helps! 
> 
> -Nat
> --
> 
> Backtrace:
> --
> 
> --
>