diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-05-06 18:32:36 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-05-06 18:32:36 -0700 |
commit | d59e9a479ac74b8addc96c4bceeb3845464a05f8 (patch) | |
tree | 9db464d046a0b91d96b13315f6e53d34373047f1 | |
parent | a14047894ed3368c80fae349a1499b7d0b4d16db (diff) | |
download | txr-d59e9a479ac74b8addc96c4bceeb3845464a05f8.tar.gz txr-d59e9a479ac74b8addc96c4bceeb3845464a05f8.tar.bz2 txr-d59e9a479ac74b8addc96c4bceeb3845464a05f8.zip |
buf: buf_ash: fix buffer overrrun.
* buf.c (buf_ash): Loop must be clamped the
smaller length of the result, cnlen.
-rw-r--r-- | buf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1456,7 +1456,7 @@ val buf_ash(val buf, val bits) struct buf *nbh = buf_handle(nbuf, self); ucnum i; - for (i = 0; i < len; i++) { + for (i = 0; i < cnlen; i++) { unsigned by = bh->data[i + v]; nbh->data[i] = (by | acc) >> r; acc = by << 8; |