/*
* command.c: Child command execution
*
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2010-2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
buf = cmd->errbuf;
len = &errlen;
}
+ /* Silence a false positive from clang. */
+ sa_assert(buf);
done = read(fds[i].fd, data, sizeof(data));
if (done < 0) {
ret = 0;
cleanup:
- if (*cmd->outbuf)
+ if (cmd->outbuf && *cmd->outbuf)
(*cmd->outbuf)[outlen] = '\0';
- if (*cmd->errbuf)
+ if (cmd->errbuf && *cmd->errbuf)
(*cmd->errbuf)[errlen] = '\0';
return ret;
}
int ret = 0;
char *outbuf = NULL;
char *errbuf = NULL;
- int infd[2];
+ int infd[2] = { -1, -1 };
struct stat st;
bool string_io;
bool async_io = false;