static void determine_device_blocks(struct fs_control *ctl, const struct stat *statbuf)
{
- unsigned long long dev_blocks;
+ unsigned long long dev_blocks = 0;
if (S_ISBLK(statbuf->st_mode)) {
int sectorsize;
nparts = fdisk_table_get_nents(tb);
if (nparts) {
- size_t cur_partno;
+ size_t cur_partno = (size_t) -1;
struct fdisk_partition *pa = fdisk_table_get_partition(tb, nparts - 1);
assert(pa);
while (1) {
struct dos_partition *p, *p0;
- uint32_t start, size;
+ uint32_t start = 0, size;
if (++ct_nodata > 100)
return BLKID_PROBE_OK;
blkid_partition blkid_partlist_devno_to_partition(blkid_partlist ls, dev_t devno)
{
struct path_cxt *pc;
- uint64_t start, size;
+ uint64_t start = 0, size;
int i, rc, partno = 0;
DBG(LOWPROBE, ul_debug("trying to convert devno 0x%llx to partition",
size_t i;
struct ddf_header *ddf = NULL;
char version[DDF_REV_LENGTH + 1];
- uint64_t off, lba;
+ uint64_t off = 0, lba;
if (pr->size < 0x30000)
return 1;
unsigned int off = 0;
unsigned int blocksize;
unsigned int cat_block;
- unsigned int ext_block_start;
+ unsigned int ext_block_start = 0;
unsigned int ext_block_count;
unsigned int record_count;
unsigned int leaf_node_head;
const struct blkid_idmag *mag __attribute__((__unused__)))
{
int swab_endian = 0;
- struct zfs_uberblock *ub;
+ struct zfs_uberblock *ub = NULL;
loff_t offset = 0, ub_offset = 0;
int label_no, found = 0, found_in_label;
void *label;
} else {
char hint[BUFSIZ];
struct fdisk_ask *ask;
- int c;
+ int c = 0;
/* the default layout for scripts is to create primary partitions */
if (cxt->script || !fdisk_has_dialogs(cxt)) {
struct fdisk_iter *itr,
struct fdisk_partition **res, int *change)
{
- struct fdisk_partition *pa, *pb;
+ struct fdisk_partition *pa = NULL, *pb;
int rc = 1;
assert(itr);
static int unix_socket(struct logger_ctl *ctl, const char *path, int *socket_type)
{
- int fd, i, type = -1;
+ int fd = -1, i, type = -1;
static struct sockaddr_un s_addr; /* AF_UNIX address of local logger */
if (strlen(path) >= sizeof(s_addr.sun_path))
uuid_t uu;
char reply_buf[1024], *cp;
char op, str[UUID_STR_LEN];
- int i, ns, len, num;
+ int i, ns, len;
+ int num; /* intentionally uninitialized */
int s = 0;
int fd_pidfile = -1;
int ret;
size_t i;
uuid_t buf;
int invalid = 0;
- int variant, type;
+ int variant = -1, type = -1;
assert(tb);
assert(uuid);
const struct timeval startup_time, struct adjtime *adjtime)
{
/* The time at which we read the Hardware Clock */
- struct timeval read_time;
+ struct timeval read_time = { 0 };
/*
* The Hardware Clock gives us a valid time, or at
* least something close enough to fool mktime().
unsigned long long add0 = 0;
unsigned int step;
unsigned int *buf, total, fn_len;
- unsigned long long fn_add, next_add; /* current and next address */
+ unsigned long long fn_add = 0, next_add; /* current and next address */
char fn_name[S_LEN], next_name[S_LEN]; /* current and next name */
char mode[8];
int c;
int verbose = 0;
int archwrapper;
int c;
- struct arch_domain *doms, *target;
+ struct arch_domain *doms, *target = NULL;
unsigned long pers_value = 0;
char *shell = NULL, *shell_arg = NULL;