summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
327e75b)
Two instances, both spotted by Coverity. In one, two blocks were
swapped. In the other, the check is not needed anymore.
Cc: qemu-stable@nongnu.org
Cc: qemu-trivial@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit
a4cc73d629d43c8a4d171d043ff229a959df3ca6)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
buf = qstring_get_str(mon->outbuf);
len = qstring_get_length(mon->outbuf);
buf = qstring_get_str(mon->outbuf);
len = qstring_get_length(mon->outbuf);
- if (mon && len && !mon->mux_out) {
+ if (len && !mon->mux_out) {
rc = qemu_chr_fe_write(mon->chr, (const uint8_t *) buf, len);
if (rc == len) {
/* all flushed */
rc = qemu_chr_fe_write(mon->chr, (const uint8_t *) buf, len);
if (rc == len) {
/* all flushed */
FILE *stdio_file;
QEMUFileStdio *s;
FILE *stdio_file;
QEMUFileStdio *s;
- stdio_file = popen(command, mode);
- if (stdio_file == NULL) {
+ if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
+ fprintf(stderr, "qemu_popen: Argument validity check failed\n");
- if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
- fprintf(stderr, "qemu_popen: Argument validity check failed\n");
+ stdio_file = popen(command, mode);
+ if (stdio_file == NULL) {