unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#15100: Division by zero in bytevector->uint-list
@ 2013-08-15 11:02 Göran Weinholt
  2013-08-17  3:19 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Göran Weinholt @ 2013-08-15 11:02 UTC (permalink / raw)
  To: 15100

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

Hello schemers,

the bytevector->uint-list procedure from (rnrs) can crash Guile through
a division by zero:

scheme@(guile-user)> (import (rnrs))
scheme@(guile-user)> (bytevector->uint-list #vu8(0) 'x 0)
Floating point exception

The same happens with bytevector->sint-list. These procedures also do
not check that the length of the bytevector is divisible by the size.

Tested with GNU Guile 2.0.9.71-8d5d04.

Regards,

-- 
Göran Weinholt <goran@weinholt.se>
"What's worse than clowns? Danish clowns."
  -- Mystery Science Theatre 3000

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#15100: Division by zero in bytevector->uint-list
  2013-08-15 11:02 bug#15100: Division by zero in bytevector->uint-list Göran Weinholt
@ 2013-08-17  3:19 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2013-08-17  3:19 UTC (permalink / raw)
  To: Göran Weinholt; +Cc: 15100-done

Göran Weinholt <goran@weinholt.se> writes:

> the bytevector->uint-list procedure from (rnrs) can crash Guile through
> a division by zero:
>
> scheme@(guile-user)> (import (rnrs))
> scheme@(guile-user)> (bytevector->uint-list #vu8(0) 'x 0)
> Floating point exception
>
> The same happens with bytevector->sint-list.

Fixed in 088cfb7d761b01a2620d78f10e8dbcaa07485a32.

> These procedures also do not check that the length of the bytevector
> is divisible by the size.

I don't think we can fix this in stable-2.0, because some existing code
might depend on our current permissive behavior.  However, I fixed it on
the master branch in c099201da1de71652b9791fb0a3a863b6d3c355d.

    Thanks!
      Mark





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-17  3:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-15 11:02 bug#15100: Division by zero in bytevector->uint-list Göran Weinholt
2013-08-17  3:19 ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).