Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jun 2004 18:34:39 +0300
From:      Maxim Sobolev <sobomax@portaone.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Bug in gbde(8) utility
Message-ID:  <40DAF48F.5020905@portaone.com>

next in thread | raw e-mail | index | archive | help
Hi Poul,

I am currently experimenting with your great GBDE module and found that 
there apparently a bug in gbde(8) utility, particularly it can't handle 
number of keys less than G_BDE_MAXKEYS, though documentation says that 
it should. The problem is that around line 655 of gbde.c you are 
initialising locations of unused lock sectors with random values without 
performing any bounds checking, so that when later on around line 440 
you are trying to lseek() to that location operation can fail due to 
size of the disk being less than that random value. You can easily 
reproduce the problem by trying invoking gbde with number_of_keys = 1, 
random_bits() usually generates very huge numbers so that chances to hit 
disk limit are quite high.

Please fix.

Thanks!

-Maxim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40DAF48F.5020905>