summaryrefslogtreecommitdiff
path: root/usr/src/common
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-12-30 15:05:56 +0200
committerToomas Soome <tsoome@me.com>2020-03-16 08:57:02 +0200
commit584b574a3b16c6772c8204ec1d1c957c56f22a87 (patch)
treec9bfd155a2c2edf14608a4ee0d1b328680cde6d8 /usr/src/common
parent34a4e6b53d2e6f2605fd77cda5b161201d7d0f20 (diff)
downloadillumos-joyent-584b574a3b16c6772c8204ec1d1c957c56f22a87.tar.gz
12174 i86pc: variable may be used uninitialized
Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Andrew Stormont <astormont@racktopsystems.com> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/common')
-rw-r--r--usr/src/common/dis/i386/dis_tables.c4
-rw-r--r--usr/src/common/fs/hsfs.c5
-rw-r--r--usr/src/common/fs/ufsops.c9
-rw-r--r--usr/src/common/util/string.c2
4 files changed, 12 insertions, 8 deletions
diff --git a/usr/src/common/dis/i386/dis_tables.c b/usr/src/common/dis/i386/dis_tables.c
index 928fa51916..4d26a7ac2c 100644
--- a/usr/src/common/dis/i386/dis_tables.c
+++ b/usr/src/common/dis/i386/dis_tables.c
@@ -3626,7 +3626,7 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex)
int
dtrace_disx86(dis86_t *x, uint_t cpu_mode)
{
- const instable_t *dp; /* decode table being used */
+ const instable_t *dp = NULL; /* decode table being used */
#ifdef DIS_TEXT
uint_t i;
#endif
@@ -6406,6 +6406,8 @@ L_VEX_RM:
done:
#ifdef DIS_MEM
+ if (dp == NULL)
+ return (1);
/*
* compute the size of any memory accessed by the instruction
*/
diff --git a/usr/src/common/fs/hsfs.c b/usr/src/common/fs/hsfs.c
index 9efe265cfa..e648d03360 100644
--- a/usr/src/common/fs/hsfs.c
+++ b/usr/src/common/fs/hsfs.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Basic file system reading code for standalone I/O system.
* Simulates a primitive UNIX I/O system (read(), write(), open(), etc).
@@ -174,7 +172,7 @@ opendir(ino_t inode, fileid_t *filep)
filep->fi_blocknum = hdbtodb(inode);
if (inode != root_ino)
- return (0);
+ return (0);
if (parse_dir(filep, 0, &hsdep) > 0) {
struct inode *ip;
@@ -198,6 +196,7 @@ find(char *path, fileid_t *filep)
char c;
ino_t n;
+ n = 0;
dprintf("find: %s\n", path);
if (path == NULL || *path == '\0')
return (0);
diff --git a/usr/src/common/fs/ufsops.c b/usr/src/common/fs/ufsops.c
index 52e716f1de..a467f41202 100644
--- a/usr/src/common/fs/ufsops.c
+++ b/usr/src/common/fs/ufsops.c
@@ -69,15 +69,15 @@ static fileid_t *head;
devid_t *ufs_devp;
struct dirinfo {
- int loc;
+ int loc;
fileid_t *fi;
};
static int bufs_close(int);
static void bufs_closeall(int);
-static ino_t find(fileid_t *filep, char *path);
+static ino_t find(fileid_t *filep, char *path);
static ino_t dlook(fileid_t *filep, char *path);
-static daddr32_t sbmap(fileid_t *filep, daddr32_t bn);
+static daddr32_t sbmap(fileid_t *filep, daddr32_t bn);
static struct direct *readdir(struct dirinfo *dstuff);
static void set_cache(int, void *, uint_t);
static void *get_cache(int);
@@ -151,9 +151,10 @@ find(fileid_t *filep, char *path)
int len, r;
devid_t *devp;
+ inode = 0;
if (path == NULL || *path == '\0') {
printf("null path\n");
- return ((ino_t)0);
+ return (inode);
}
dprintf("openi: %s\n", path);
diff --git a/usr/src/common/util/string.c b/usr/src/common/util/string.c
index 5fe5ddab13..2ed2791eda 100644
--- a/usr/src/common/util/string.c
+++ b/usr/src/common/util/string.c
@@ -80,6 +80,8 @@ vsnprintf(char *buf, size_t buflen, const char *fmt, va_list aargs)
int numwidth;
va_list args;
+ ul = 0;
+ bs = NULL;
/*
* Make a copy so that all our callers don't have to make a copy
*/