GNU bug report logs - #31528
patch get-bytevector-n to read more than 4 GB

Previous Next

Package: guile;

Reported by: Jan Šmydke <jan.smydke <at> gmail.com>

Date: Sat, 19 May 2018 15:26:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Šmydke <jan.smydke <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: patch get-bytevector-n to read more than 4 GB
Date: Sat, 19 May 2018 13:10:15 +0200
[Message part 1 (text/plain, inline)]
Hi,

I found

(use-modules (rnrs io ports))

(define v (call-with-input-file "EIVE01.DAT" (lambda (port)
>
  (get-bytevector-n port (* 5 1024 1024 1024)))))
>

fails due to 'out of range':

ERROR: In procedure get-bytevector-n:

ERROR: Value out of range 0 to 4294967295: 52434042880


 The "count" variable was of "unsigned" type (i.e. 32-bit) so I changed it
to "size_t" and the problem is solved.

Enclosed is the corresponding patch (using format-patch)

Jan Šmydke
[Message part 2 (text/html, inline)]
[patch (application/octet-stream, attachment)]

This bug report was last modified 7 years and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.