@@ -82,7 +82,7 @@ global_hdr_alloc(int argc, char *argv[])
/* fill in the magic number
*/
- strncpy(ghdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ);
+ memcpy(ghdrp->gh_magic, GLOBAL_HDR_MAGIC, GLOBAL_HDR_MAGIC_SZ);
/* fill in the hdr version
*/
@@ -6348,7 +6348,7 @@ static bool_t
Media_prompt_erase(drive_t *drivep)
{
fold_t fold;
- char question[100];
+ char question[256];
char *preamblestr[PREAMBLEMAX];
size_t preamblecnt;
char *querystr[QUERYMAX];
@@ -6375,7 +6375,7 @@ Media_prompt_erase(drive_t *drivep)
/* query: ask if overwrite ok
*/
- sprintf(question,
+ snprintf(question, sizeof(question),
"pre-erase (-%c) option specified "
"and non-blank media encountered:\n"
"please confirm media erase "
@@ -149,7 +149,7 @@ fstab_select(WINDOW *win, node_t *current, node_t *list)
int
fstab_highlight(WINDOW *win, node_t *current, node_t *list)
{
- static char txt[256];
+ static char txt[512];
char uuidstr[UUID_STR_LEN + 1];
data_t *d;
invt_fstab_t *fstabentry;
@@ -115,7 +115,7 @@ invidx_commit(WINDOW *win, node_t *current, node_t *list)
struct stat s;
char dst_stobjfile[MAXPATHLEN];
char *stobjfile;
- char cmd[1024];
+ char cmd[(MAXPATHLEN * 2) + 16];
snprintf(dst_idxfile, sizeof(dst_idxfile), "%s/%s", inventory_path, basename(invidx_file[fidx].name));
@@ -688,7 +688,7 @@ invidx_select(WINDOW *win, node_t *current, node_t *list)
int
invidx_highlight(WINDOW *win, node_t *current, node_t *list)
{
- static char txt[256];
+ static char txt[512];
data_t *d;
invt_entry_t *invtentry;
@@ -101,7 +101,7 @@ menu(WINDOW *win, int line, int col, node_t *list, int keyc, menukey_t *keyv)
int c;
int k;
int quit;
- char txt[256];
+ char txt[512];
node_t *current;
node_t *last;
data_t *d;
@@ -171,7 +171,7 @@ stobjsess_commit(WINDOW *win, node_t *current, node_t *list)
int
stobjsess_highlight(WINDOW *win, node_t *current, node_t *list)
{
- static char txt[256];
+ static char txt[512];
char uuidstr[UUID_STR_LEN + 1];
data_t *d;
invt_seshdr_t *stobjhdr;
@@ -210,7 +210,7 @@ stobjsess_highlight(WINDOW *win, node_t *current, node_t *list)
int
stobjstrm_highlight(WINDOW *win, node_t *current, node_t *list)
{
- static char txt[256];
+ static char txt[512];
data_t *d;
invt_stream_t *stobjstrm;
@@ -246,7 +246,7 @@ stobjstrm_highlight(WINDOW *win, node_t *current, node_t *list)
int
stobjmed_highlight(WINDOW *win, node_t *current, node_t *list)
{
- static char txt[256];
+ static char txt[512];
char uuidstr[UUID_STR_LEN + 1];
data_t *d;
invt_mediafile_t *stobjmed;
@@ -5077,7 +5077,7 @@ pi_insertfile(ix_t drivecnt,
&&
! DH2O(objh)->o_idlabvalpr) {
uuid_copy(DH2O(objh)->o_id, *mediaidp);
- strncpy(DH2O(objh)->o_lab,
+ memcpy(DH2O(objh)->o_lab,
medialabel,
sizeof(DH2O(objh)->o_lab));
DH2O(objh)->o_idlabvalpr = BOOL_TRUE;
@@ -5107,7 +5107,7 @@ pi_insertfile(ix_t drivecnt,
&&
! DH2O(prevobjh)->o_idlabvalpr) {
uuid_copy(DH2O(prevobjh)->o_id, *prevmediaidp);
- strncpy(DH2O(prevobjh)->o_lab,
+ memcpy(DH2O(prevobjh)->o_lab,
prevmedialabel,
sizeof(DH2O(prevobjh)->o_lab));
DH2O(prevobjh)->o_idlabvalpr = BOOL_TRUE;
@@ -8632,7 +8632,6 @@ restore_extattr(drive_t *drivep,
{
drive_ops_t *dop = drivep->d_opsp;
extattrhdr_t *ahdrp = (extattrhdr_t *)get_extattrbuf(drivep->d_index);
- stream_context_t *strctxp = (stream_context_t *)drivep->d_strmcontextp;
bstat_t *bstatp = &fhdrp->fh_stat;
bool_t isfilerestored = BOOL_FALSE;