Re: [PATCH] qtest/migration: Fix potential NPD through getenv

2025-06-28 Thread Xingjing Deng
Hi, thank you for getting back to me. During my data mining, I came across the following operation: migration_get_env, which is called after find_common_machine_version. Based on this, I initially suspected there might be a bug. Here's the relevant code inside migration_get_env. env->qemu_src =

Re: [PATCH] qtest/migration: Fix potential NPD through getenv

2025-06-27 Thread Fabiano Rosas
xjdeng writes: Hi, thanks for the interest in fixing this. However, the analysis it not quite right: > In `find_common_machine_version`, the code previously assumed that > `getenv(var1)` and `getenv(var2)` would always return non-NULL values. That's not true. qtest_qemu_binary() has: if (v

[PATCH] qtest/migration: Fix potential NPD through getenv

2025-06-27 Thread xjdeng
In `find_common_machine_version`, the code previously assumed that `getenv(var1)` and `getenv(var2)` would always return non-NULL values. However, if either environment variable is not set, `getenv` returns NULL, which could lead to a null pointer dereference. Tracing upstream usage: `find_common_

[PATCH] qtest/migration: Fix potential NPD through getenv

2025-06-26 Thread xjdeng
In `find_common_machine_version`, the code previously assumed that `getenv(var1)` and `getenv(var2)` would always return non-NULL values. However, if either environment variable is not set, `getenv` returns NULL, which could lead to a null pointer dereference. Tracing upstream usage: `find_common_