Re: [PATCH] virt-login-shell: check for NULL from virGetLastError()

2025-10-01 Thread Denis Rastyogin
Indeed, when virDomainCreate() < 0, virDispatchError() should be invoked, but since we do not check its return value, there is no absolute guarantee that the error message will always be set successfully. virDispatchError() contains the following code: virErrorPtr err = virLastErrorOb

[PATCH] virt-login-shell: check for NULL from virGetLastError()

2025-10-01 Thread gerben
From: Denis Rastyogin virGetLastError() may return NULL in case of OOM. Without a check this could lead to a NULL pointer dereference when accessing its fields. The result of virGetLastError() is usually checked in other places, so add the missing check here as well. Found by Linux Verification