diff options
| author | Toomas Soome <tsoome@me.com> | 2018-11-27 18:30:07 +0200 |
|---|---|---|
| committer | Richard Lowe <richlowe@richlowe.net> | 2018-12-29 21:49:23 +0000 |
| commit | 3ab8de02e091bc75fc50aafc5cbe32c053451d88 (patch) | |
| tree | fc77e88945e4899a4165d600ccd149fa43e3f33a | |
| parent | cd8e64e261b359d5d54dad750f50660d3b874238 (diff) | |
| download | illumos-joyent-3ab8de02e091bc75fc50aafc5cbe32c053451d88.tar.gz | |
10164 crle: passing argument 2 to restrict-qualified parameter aliases with argument 1
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
| -rw-r--r-- | usr/src/cmd/sgs/crle/common/inspect.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/usr/src/cmd/sgs/crle/common/inspect.c b/usr/src/cmd/sgs/crle/common/inspect.c index 7f68c77a27..38667fccba 100644 --- a/usr/src/cmd/sgs/crle/common/inspect.c +++ b/usr/src/cmd/sgs/crle/common/inspect.c @@ -97,8 +97,8 @@ enteralt(Crle_desc *crle, const char *path, const char *file, Half flags, if (flags & RTC_OBJ_DUMP) { char _alter[PATH_MAX]; - (void) strcpy(_alter, crle->c_objdir); - (void) realpath(_alter, _alter); + (void) strlcpy(alter, crle->c_objdir, sizeof (alter)); + (void) realpath(alter, _alter); (void) snprintf(alter, PATH_MAX, MSG_ORIG(MSG_FMT_PATH), _alter, file); if (strcmp(alter, obj->o_path) == 0) { @@ -107,9 +107,10 @@ enteralt(Crle_desc *crle, const char *path, const char *file, Half flags, return (0); } obj->o_flags |= RTC_OBJ_DUMP; - } else + } else { (void) snprintf(alter, PATH_MAX, MSG_ORIG(MSG_FMT_PATH), crle->c_objdir, file); + } obj->o_flags |= RTC_OBJ_ALTER; /* @@ -119,8 +120,9 @@ enteralt(Crle_desc *crle, const char *path, const char *file, Half flags, if (obj->o_alter) { crle->c_strsize -= strlen(alter) + 1; fmt = MSG_INTL(MSG_DIA_ALTUPDATE); - } else + } else { fmt = MSG_INTL(MSG_DIA_ALTCREATE); + } /* * Allocate the new alternative and update the string table size. @@ -397,8 +399,9 @@ _enterfile(Crle_desc *crle, const char *file, int off, Hash_ent *fent, if ((nfile = malloc(size)) == NULL) return (0); (void) strcpy(nfile, file); - } else + } else { nfile = (char *)file; + } fent->e_key = (Addr)nfile; fent->e_off = off; @@ -1028,9 +1031,9 @@ inspect(Crle_desc *crle, const char *name, Half flags) } else { size_t off = file - name; - if (file == name) + if (file == name) { dir = MSG_ORIG(MSG_DIR_ROOT); - else { + } else { (void) strncpy(_dir, name, off); _dir[off] = '\0'; dir = (const char *)_dir; |
