diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-24 10:17:57 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-24 10:17:57 -0700 |
commit | 42379dfdd0d10c9ce9ba3f7c2c7e26083e240e68 (patch) | |
tree | 517806433a7fac9ce4df8443a2aa8d0e800e71c2 /gc.c | |
parent | 3c0df649d00d55a31e6f92c29bc3976fdba27f8e (diff) | |
download | txr-42379dfdd0d10c9ce9ba3f7c2c7e26083e240e68.tar.gz txr-42379dfdd0d10c9ce9ba3f7c2c7e26083e240e68.tar.bz2 txr-42379dfdd0d10c9ce9ba3f7c2c7e26083e240e68.zip |
sha256/md5: state-based hash: handle size_t overflow.
* chksum.c (sha256_szmax_upd, md5_szmax_upd): New static
functions, consisting of logic from sha256_buf and
md5_buf, respectively.
(sha256_buf, md5_buf): Use sha256_szmax_up and md5_szmax_upd,
respectively, to handle the unlikely possiblity of the ucnum
buffer length being larger than the range of size_t.
(sha256_hash, md5_hash): Also use the new static functions
instead of callig SHA256_update or MD5_update directly
to deal with the same issue.
Diffstat (limited to 'gc.c')
0 files changed, 0 insertions, 0 deletions