Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#142 closed defect (fixed)

move-memory! accepts negative offsets

Reported by: Jim Ursetto Owned by: felix winkelmann
Priority: major Milestone:
Component: core libraries Version: 4.2.x
Keywords: Cc:
Estimated difficulty:

Description

And will clobber memory. It does detect the error when the offsets are too large though.

(define b (string->blob (make-string 10 #\nul)))
(move-memory! "foo" b 3 0 7)      ; ok
,d b
blob of size 10:
   0: 00 00 00 00 00 00 00 66 6f 6f      .......foo

(move-memory! "foo" b 3 0 8)      ; error (out of range)
(move-memory! "xyz" b 3 -1 0)     ; succeeds
,d b
blob of size 10:
   0: 42 78 79 00 00 00 00 66 6f 6f      Byz....foo

(move-memory! "xyz" b 3 0 -1)     ; succeeds
,d b
unknown object

Change History (3)

comment:1 Changed 14 years ago by felix winkelmann

Owner: set to felix winkelmann
Status: newaccepted

comment:2 Changed 14 years ago by felix winkelmann

Resolution: fixed
Status: acceptedclosed

Fixed in 72be4d4334280a8bcd83a91253295fb8e32debd7 (master)

comment:3 Changed 14 years ago by (none)

Milestone: 4.3.0

Milestone 4.3.0 deleted

Note: See TracTickets for help on using tickets.