]> Savannah Git Hosting - gnulib.git/commit
file-has-acl: minor ENOMEM fixes
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Nov 2024 17:37:17 +0000 (09:37 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 7 Nov 2024 19:45:02 +0000 (11:45 -0800)
commit407d038993aa2e1894c7312b94d0798d4cd96f02
tree07ece0a97e4fcfa131afeac9b21a7adc087230ae
parenta44d8b6c280e55873aadc88354a353abc8eac188
file-has-acl: minor ENOMEM fixes

* lib/file-has-acl.c: Include limits.h.
(get_aclinfo): Use a saturating add rather than reporting
overflow, in the very unlikely case that the size overflows.
This is simpler and is good enough here.
Also, defend against implausible system that fails with ERANGE
even when the buffer size is SSIZE_MAX.
(file_has_aclinfo): Since we already assume elsewhere that
malloc sets errno, rely on that here too.
* modules/file-has-acl (Depends-on): Add limits.h.
Also add malloc-posix, since we rely on malloc errno.
ChangeLog
lib/file-has-acl.c
modules/file-has-acl