diff options
author | Jacek Sieka <arnetheduck@gmail.com> | 2016-04-26 21:25:57 +0800 |
---|---|---|
committer | Jacek Sieka <arnetheduck@gmail.com> | 2016-04-26 21:25:57 +0800 |
commit | ba1a52614b3feccaadadebf45cf897192902ed4d (patch) | |
tree | cd66f3d4ba01d25499aa452e68cd34c192804e9c /lib/system/sysio.nim | |
parent | a2501321c39a89fb0bad52dcb8ef7c974d4ae5d2 (diff) | |
parent | e31ec746b96ef185d9f5fa6276518949fa889e5a (diff) | |
download | Nim-ba1a52614b3feccaadadebf45cf897192902ed4d.tar.gz |
Merge remote-tracking branch 'origin/devel' into malloc-store-size
Diffstat (limited to 'lib/system/sysio.nim')
-rw-r--r-- | lib/system/sysio.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index d0bba6775..3c34215ac 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -58,6 +58,8 @@ proc readBytes(f: File, a: var openArray[int8|uint8], start, len: Natural): int result = readBuffer(f, addr(a[start]), len) proc readChars(f: File, a: var openArray[char], start, len: Natural): int = + if (start + len) > len(a): + raiseEIO("buffer overflow: (start+len) > length of openarray buffer") result = readBuffer(f, addr(a[start]), len) proc write(f: File, c: cstring) = fputs(c, f) |