[PATCH 21/21] examples/vhost: replace strtok with strtok_r

Stephen Hemminger stephen at networkplumber.org
Mon Nov 13 17:26:20 CET 2023


On Mon, 13 Nov 2023 18:45:50 +0800
Jie Hai <haijie1 at huawei.com> wrote:

> Multiple threads calling the same function may cause condition
> race issues, which often leads to abnormal behavior and can cause
> more serious vulnerabilities such as abnormal termination, denial
> of service, and compromised data integrity.
> 
> The strtok() is non-reentrant, it is better to replace it with a
> reentrant function.
> 
> Signed-off-by: Jie Hai <haijie1 at huawei.com>

This is in initialization code, can not be called by multiple threads.


More information about the dev mailing list