diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-05-10 14:38:11 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-05-10 14:38:11 +0000 |
commit | 84c9dd0d237ccba9e15a9356be17a8e307bbbd29 (patch) | |
tree | e22f5ca29614d687aa9872b9ef5e9458c38a7493 /gnu/usr.bin | |
parent | c0ab56871f11e42f0419006136422b9b56d79e9f (diff) |
fix a few strcpy issues.
okay millert@, nicm@ ...
(thx others for pointing out stupidity in intermediate patches...)
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/gcc/gcc/config/i386/i386.c | 8 | ||||
-rw-r--r-- | gnu/usr.bin/gcc/gcc/gcc.c | 40 |
2 files changed, 24 insertions, 24 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/i386/i386.c b/gnu/usr.bin/gcc/gcc/config/i386/i386.c index a94bc410f22..62718ba7c26 100644 --- a/gnu/usr.bin/gcc/gcc/config/i386/i386.c +++ b/gnu/usr.bin/gcc/gcc/config/i386/i386.c @@ -7504,14 +7504,14 @@ output_387_binary_op (insn, operands) if (is_sse) { - strcpy (buf, ssep); + strlcpy (buf, ssep, sizeof buf); if (GET_MODE (operands[0]) == SFmode) - strcat (buf, "ss\t{%2, %0|%0, %2}"); + strlcat (buf, "ss\t{%2, %0|%0, %2}", sizeof buf); else - strcat (buf, "sd\t{%2, %0|%0, %2}"); + strlcat (buf, "sd\t{%2, %0|%0, %2}", sizeof buf); return buf; } - strcpy (buf, p); + strlcpy (buf, p, sizeof buf); switch (GET_CODE (operands[3])) { diff --git a/gnu/usr.bin/gcc/gcc/gcc.c b/gnu/usr.bin/gcc/gcc/gcc.c index f7b0fe2949c..9d068ae27d2 100644 --- a/gnu/usr.bin/gcc/gcc/gcc.c +++ b/gnu/usr.bin/gcc/gcc/gcc.c @@ -2370,7 +2370,7 @@ find_a_file (pprefix, name, mode, multilib) { if (access (name, mode) == 0) { - strcpy (temp, name); + strlcpy (temp, name, len); return temp; } } @@ -2386,10 +2386,10 @@ find_a_file (pprefix, name, mode, multilib) So try appending that first. */ if (file_suffix[0] != 0) { - strcpy (temp, pl->prefix); - strcat (temp, machine_suffix); - strcat (temp, multilib_name); - strcat (temp, file_suffix); + strlcpy (temp, pl->prefix, len); + strlcat (temp, machine_suffix, len); + strlcat (temp, multilib_name, len); + strlcat (temp, file_suffix, len); if (access_check (temp, mode) == 0) { if (pl->used_flag_ptr != 0) @@ -2399,9 +2399,9 @@ find_a_file (pprefix, name, mode, multilib) } /* Now try just the multilib_name. */ - strcpy (temp, pl->prefix); - strcat (temp, machine_suffix); - strcat (temp, multilib_name); + strlcpy (temp, pl->prefix, len); + strlcat (temp, machine_suffix, len); + strlcat (temp, multilib_name, len); if (access_check (temp, mode) == 0) { if (pl->used_flag_ptr != 0) @@ -2418,10 +2418,10 @@ find_a_file (pprefix, name, mode, multilib) So try appending that first. */ if (file_suffix[0] != 0) { - strcpy (temp, pl->prefix); - strcat (temp, just_machine_suffix); - strcat (temp, multilib_name); - strcat (temp, file_suffix); + strlcpy (temp, pl->prefix, len); + strlcat (temp, just_machine_suffix, len); + strlcat (temp, multilib_name, len); + strlcat (temp, file_suffix, len); if (access_check (temp, mode) == 0) { if (pl->used_flag_ptr != 0) @@ -2430,9 +2430,9 @@ find_a_file (pprefix, name, mode, multilib) } } - strcpy (temp, pl->prefix); - strcat (temp, just_machine_suffix); - strcat (temp, multilib_name); + strlcpy (temp, pl->prefix, len); + strlcat (temp, just_machine_suffix, len); + strlcat (temp, multilib_name, len); if (access_check (temp, mode) == 0) { if (pl->used_flag_ptr != 0) @@ -2449,9 +2449,9 @@ find_a_file (pprefix, name, mode, multilib) So try appending that first. */ if (file_suffix[0] != 0) { - strcpy (temp, pl->prefix); - strcat (temp, this_name); - strcat (temp, file_suffix); + strlcpy (temp, pl->prefix, len); + strlcat (temp, this_name, len); + strlcat (temp, file_suffix, len); if (access_check (temp, mode) == 0) { if (pl->used_flag_ptr != 0) @@ -2460,8 +2460,8 @@ find_a_file (pprefix, name, mode, multilib) } } - strcpy (temp, pl->prefix); - strcat (temp, this_name); + strlcpy (temp, pl->prefix, len); + strlcat (temp, this_name, len); if (access_check (temp, mode) == 0) { if (pl->used_flag_ptr != 0) |