selinux/libselinux
Christian Göttsche 0aa974a439 libselinux: limit has buffer size
The `struct selabel_digest` member `hashbuf_size` is used to compute
hashes via `Sha1Update()`, which takes uint32_t as length parameter
type.  Use that same type for `hashbuf_size` to avoid potential value
truncations, as the overflow check in `digest_add_specfile()` on
`hashbuf_size` is based on it.

    label_support.c: In function ‘digest_gen_hash’:
    label_support.c:125:53: warning: conversion from ‘size_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Wconversion]
      125 |         Sha1Update(&context, digest->hashbuf, digest->hashbuf_size);
          |                                               ~~~~~~^~~~~~~~~~~~~~

Acked-by: James Carter <jwcart2@gmail.com>
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2022-04-12 13:09:47 -04:00
..
include selinux_restorecon: introduce selinux_restorecon_parallel(3) 2021-11-23 10:03:18 +01:00
man selinux_restorecon: introduce selinux_restorecon_parallel(3) 2021-11-23 10:03:18 +01:00
src libselinux: limit has buffer size 2022-04-12 13:09:47 -04:00
utils libselinux/utils: check for valid contexts to improve error causes 2022-04-12 13:09:27 -04:00
LICENSE
Makefile libselinux: use PCRE2 by default 2021-12-09 11:07:00 -05:00
VERSION Update VERSIONs to 3.4-rc1 for release. 2022-04-06 19:53:39 +02:00