bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnutls missing largefile support


From: Bruno Haible
Subject: Re: gnutls missing largefile support
Date: Tue, 8 Nov 2011 00:10:58 +0100
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Nikos Mavrogiannopoulos wrote:
> We only use file
> support to open configuration files, or files containing certificates,
> files that if they exceed 2GB then something is wrong.

Indeed, after taking a look at gnutls-3.0.6/lib/opencdk/keydb.[hc] I can
even tell you what will be wrong: If someone creates a keyring file
with size > 4 GB, then the key at offset 2^32 + o will be confused
with the key at offset o. _Even_ if off_t is 64-bit. Because the off_t value
is stored as 32 bits in an index file used for searching.

And the function cdk_file_armor in gnutls-3.0.6/lib/opencdk/armor.c
(is this the same function as "gpg -a"?) ought to work with arbitrarily
large binary files, right? We have the following call chain:
  cdk_file_armor -> cdk_stream_open -> _cdk_stream_open_mode -> fopen
which has the potential to misbehave if fopen() is not the same as
fopen64. [1]

Bruno

[1] 
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/posix-functions/fopen.texi;hb=HEAD
-- 
In memoriam Hannah Szenes <http://en.wikipedia.org/wiki/Hannah_Szenes>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]