Skip to content

readBin() can read beyond end of raw vector

2 messages · Henrik Bengtsson, Brian Ripley

#
FYI, in R v2.5.0 alpha, readBin() can be used to read beyond end of raw vector:
[1] 01 02 03 04 05 06 07 08 09 0a
[1]  67305985 134678021
[1]  67305985 134678021
[1]    513   1027   1541   2055   2569  29537  29541      0      9  16384
[11]   9376    453 -18208    505 -18328    505      9      0      0      0
[1]   1   2   3   4   5   6   7   8   9  10  97 115 101 115   0   0   9   0   0
[20]  64
R version 2.5.0 alpha (2007-04-04 r41043)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MON
ETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252


attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"

/Henrik
#
Thanks for the report. BTW, this is not new in 2.5.0 alpha AFAICS.

It needs a tiny change in the C function readRaw: fixed in SVN now.
On Sat, 7 Apr 2007, Henrik Bengtsson wrote: