aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-10-13 23:17:37 +0000
committerWayne Davison <wayned@samba.org>2006-10-13 23:17:37 +0000
commit204f4f4d091890d9106e744cffb9561e82df44ad (patch)
tree3d7bc6e43b6058319605d5b67972bd66fdadb54d
parentc9bce0b8f8a485f11ce4f90356e9346036f14daf (diff)
downloadandroid_external_rsync-204f4f4d091890d9106e744cffb9561e82df44ad.tar.gz
android_external_rsync-204f4f4d091890d9106e744cffb9561e82df44ad.tar.bz2
android_external_rsync-204f4f4d091890d9106e744cffb9561e82df44ad.zip
Changed strcpy() calls into memcpy() calls.
-rw-r--r--lib/compat.c10
-rw-r--r--lib/inet_ntop.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/compat.c b/lib/compat.c
index 6769490f..8718a48f 100644
--- a/lib/compat.c
+++ b/lib/compat.c
@@ -25,11 +25,11 @@
#ifndef HAVE_STRDUP
char *strdup(char *s)
{
- int l = strlen(s) + 1;
- char *ret = (char *)malloc(l);
- if (ret)
- strcpy(ret,s);
- return ret;
+ int len = strlen(s) + 1;
+ char *ret = (char *)malloc(len);
+ if (ret)
+ memcpy(ret, s, len);
+ return ret;
}
#endif
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index 7866999a..15e3ebd3 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -81,7 +81,7 @@ inet_ntop4(const unsigned char *src, char *dst, size_t size)
errno = ENOSPC;
return (NULL);
}
- strcpy(dst, tmp);
+ memcpy(dst, tmp, len + 1);
return (dst);
}
@@ -178,7 +178,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
errno = ENOSPC;
return (NULL);
}
- strcpy(dst, tmp);
+ memcpy(dst, tmp, tp - tmp);
return (dst);
}
#endif /* AF_INET6 */