Use string bound functions (take #2)
PATCH 3/3 Use string bound functions (take #2)
ia64 and ppc dependent code.
Signed-off-by Christoph Egger <[email protected]>
xen/arch/ia64/linux-xen/setup.c +2 -3
@@ -424,8 +424,7 @@ setup_arch (char **cmdline_p)else len =strlen (mvec_name); len =min (len,sizeof (str) -1 ); -strncpy (str, mvec_name, len); - str[len] ='\0' ; +strlcpy (str, mvec_name, len); mvec_name = str; }else mvec_name =acpi_get_sysname ();
@@ -564,7 +563,7 @@ show_cpuinfo (struct seq_file *m, void * *cp++ = sep; sep =',' ; *cp++ =' ' ; -strcpy (cp, feature_bits[i].feature_name); +strlcpy (cp, feature_bits[i].feature_name,sizeof (features)); cp +=strlen (feature_bits[i].feature_name); mask &= ~feature_bits[i].mask; }
xen/arch/ia64/xen/dom_fw.c +27 -22
101 lines not on this page · raw message
xen/arch/ia64/xen/domain.c +1 -2
@@ -1148,8 +1148,7 @@ int construct_dom0(struct domain *d,dom_fw_setup (d, bp_mpa, max_pages *PAGE_SIZE );/* Fill boot param. */ -strncpy ((char *)si->cmd_line, dom0_command_line,sizeof (si->cmd_line)); - si->cmd_line[sizeof (si->cmd_line)-1 ] =0 ; +strlcpy ((char *)si->cmd_line, dom0_command_line,sizeof (si->cmd_line)); bp = (struct ia64_boot_param *)((unsigned char *)si +sizeof (start_info_t));
xen/arch/ia64/xen/gdbstub.c +1 -1
@@ -639,7 +639,7 @@ kgdb_get_reg(int regnum, struct unw_fram outbuffer[size*2] = 0; }else -strcpy (outbuffer,"E0" ); +strlcpy (outbuffer,"E0" ,sizeof ("E0" ));return ;#else
xen/arch/ia64/xen/oprofile/perfmon.c +1 -1
@@ -119,7 +119,7 @@ xenoprof_arch_init(int *num_events, int xenoprof_arch_init(int *num_events, int *is_primary, char *cpu_type) { *num_events =0 ; -strncpy (cpu_type,get_cpu_type (),XENOPROF_CPU_TYPE_SIZE -1 ); +strlcpy (cpu_type,get_cpu_type (),XENOPROF_CPU_TYPE_SIZE ); cpu_type[XENOPROF_CPU_TYPE_SIZE -1 ] ='\0' ; *is_primary =0 ;
xen/arch/powerpc/domain_build.c +1 -1
@@ -290,7 +290,7 @@ int construct_dom0(struct domain *d,memset (si->cmd_line,0 ,sizeof (si->cmd_line));if ( cmdline !=NULL ) -strncpy ((char *)si->cmd_line, cmdline,sizeof (si->cmd_line)-1 ); +strlcpy ((char *)si->cmd_line, cmdline,sizeof (si->cmd_line)); v->arch.ctxt.msr = msr; v->arch.ctxt.pc = pc;
xen/arch/powerpc/of-devtree.c +1 -2
@@ -358,8 +358,7 @@ static ofdn_t ofd_node_create( n->on_io =0 ; n->on_pathlen = pathlen; n->on_last =ofd_pathsplit_left (path,'/' , pathlen); -strncpy (n->on_path, path, pathlen); - n->on_path[n->on_pathlen] =0 ; +strlcpy (n->on_path, path, pathlen);return pos; }
xen/arch/powerpc/ofd_fixup.c +1 -1
@@ -267,7 +267,7 @@ static ofdn_t ofd_chosen_props(void *m, &path[1], sizeof (path) - 1); } -strcpy (bootargs, cmdline); +strlcpy (bootargs, cmdline,sizeof (bootargs)); bsz =strlen (bootargs) +1 ; rm =sizeof (bootargs) - bsz;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel