diff options
| author | Wander Lairson Costa <wander@redhat.com> | 2026-01-06 08:49:40 -0300 |
|---|---|---|
| committer | Tomas Glozar <tglozar@redhat.com> | 2026-01-07 15:57:55 +0100 |
| commit | 7e9dfccf8f11c26208211457c4597a466135b56a (patch) | |
| tree | 12a7d6bd2cec16e848c4cc5829007d9737dda961 /rust/alloc/collections/git@git.tavy.me:linux.git | |
| parent | 648634d17c813b35da775982662e56ea8ce750de (diff) | |
rtla: Replace atoi() with a robust strtoi()
The atoi() function does not perform error checking, which can lead to
undefined behavior when parsing invalid or out-of-range strings. This
can cause issues when parsing user-provided numerical inputs, such as
signal numbers, PIDs, or CPU lists.
To address this, introduce a new strtoi() helper function that safely
converts a string to an integer. This function validates the input and
checks for overflows, returning a negative value on failure.
Replace all calls to atoi() with the new strtoi() function and add
proper error handling to make the parsing more robust and prevent
potential issues.
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260106133655.249887-5-wander@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Diffstat (limited to 'rust/alloc/collections/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
