Commit 1a4c87e
committed
Validate acl_to_text() input before forwarding to libacl
The acl_to_text() wrapper previously forwarded nullptr ACL handles
directly into libacl. Under ASan/UBSan builds this triggered
undefined behavior inside libacl internals before the library
returned an error condition.
Add explicit parameter validation in the wrapper and return EINVAL
for invalid ACL inputs before invoking libacl.
The related test was updated to validate the wrapper contract
directly by passing nullptr instead of relying on acl_get_file("")
to indirectly produce an invalid ACL handle.
This change improves defensive behavior for invalid input handling
and avoids sanitizer failures caused by passing invalid pointers
into third-party C library internals.1 parent a23098a commit 1a4c87e
2 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
403 | 409 | | |
404 | 410 | | |
405 | 411 | | |
406 | 412 | | |
407 | 413 | | |
| 414 | + | |
408 | 415 | | |
409 | 416 | | |
410 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
246 | | - | |
| 245 | + | |
| 246 | + | |
247 | 247 | | |
248 | | - | |
249 | 248 | | |
250 | | - | |
251 | | - | |
252 | 249 | | |
253 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
| |||
0 commit comments