mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-05 04:41:20 +00:00
Avoid referencing NULL pointer when copying stream error
* src/rpc/virnetclientstream.c: Avoid referencing NULL
This commit is contained in:
parent
c9ede1cfba
commit
7a779ef6a2
@ -217,13 +217,24 @@ int virNetClientStreamSetError(virNetClientStreamPtr st,
|
||||
} else {
|
||||
st->err.code = err.code;
|
||||
}
|
||||
st->err.message = *err.message;
|
||||
*err.message = NULL;
|
||||
if (err.message) {
|
||||
st->err.message = *err.message;
|
||||
*err.message = NULL;
|
||||
}
|
||||
st->err.domain = err.domain;
|
||||
st->err.level = err.level;
|
||||
st->err.str1 = *err.str1;
|
||||
st->err.str2 = *err.str2;
|
||||
st->err.str3 = *err.str3;
|
||||
if (err.str1) {
|
||||
st->err.str1 = *err.str1;
|
||||
*err.str1 = NULL;
|
||||
}
|
||||
if (err.str2) {
|
||||
st->err.str2 = *err.str2;
|
||||
*err.str2 = NULL;
|
||||
}
|
||||
if (err.str3) {
|
||||
st->err.str3 = *err.str3;
|
||||
*err.str3 = NULL;
|
||||
}
|
||||
st->err.int1 = err.int1;
|
||||
st->err.int2 = err.int2;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user