diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2018-10-30 00:50:20 +0100 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2018-10-30 01:15:04 +0100 |
commit | d7abe889accfc4a8e41d97d5f2327fde0ce9ca64 (patch) | |
tree | 3796ced04b2be2f6423b090aeb97863618503dbb /sid.ml | |
parent | 1d5a7501bbf2a33c60b24a71254b0c42939568aa (diff) | |
download | ocaml-sid-d7abe889accfc4a8e41d97d5f2327fde0ce9ca64.tar.gz |
sid: fix off by one parsing bug
In the string representation, hyphen is always succeeded by a number
so we need to terminate at input length minus one.
Diffstat (limited to 'sid.ml')
-rw-r--r-- | sid.ml | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -94,7 +94,7 @@ module StringFmt = struct let p = 4 in let p, ia = read_decimal_u64 s p in let sa = ref [] and p' = ref p in - while !p' < n && List.length !sa < max_subauth_count do + while !p' < n - 1 && List.length !sa < max_subauth_count do expect_char s '-' !p'; let np, d = read_decimal_u32 s (!p' + 1) in sa := d :: !sa; |