From aa7ad3e798ad458d59acd9c526efddd312fb485f Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Mon, 13 Mar 2017 16:24:11 +0100 Subject: [PATCH] strcpy protection --- libftasm/src/lst/ft_lst_delif.c | 2 +- libftasm/src/lst/ft_lst_removeif.c | 2 +- libftasm/src/lst/ft_lstdelone.c | 2 +- libftasm/src/lst/ft_lsteadd.c | 2 +- libftasm/src/lst/ft_lstnew.c | 2 +- libftasm/src/str/ft_str3join.c | 2 +- libftasm/src/str/ft_strcpy.c | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libftasm/src/lst/ft_lst_delif.c b/libftasm/src/lst/ft_lst_delif.c index 6e0391f8..7580ea7d 100644 --- a/libftasm/src/lst/ft_lst_delif.c +++ b/libftasm/src/lst/ft_lst_delif.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/04 11:09:12 by jhalford #+# #+# */ -/* Updated: 2017/02/17 14:07:04 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 15:36:19 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libftasm/src/lst/ft_lst_removeif.c b/libftasm/src/lst/ft_lst_removeif.c index 2cf2d53d..b82f57c2 100644 --- a/libftasm/src/lst/ft_lst_removeif.c +++ b/libftasm/src/lst/ft_lst_removeif.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/04 11:09:30 by jhalford #+# #+# */ -/* Updated: 2016/11/16 14:00:07 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 15:31:13 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libftasm/src/lst/ft_lstdelone.c b/libftasm/src/lst/ft_lstdelone.c index 957abec9..6c577504 100644 --- a/libftasm/src/lst/ft_lstdelone.c +++ b/libftasm/src/lst/ft_lstdelone.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/05 13:39:33 by jhalford #+# #+# */ -/* Updated: 2017/03/03 13:34:45 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 15:31:10 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libftasm/src/lst/ft_lsteadd.c b/libftasm/src/lst/ft_lsteadd.c index bcc3be54..142f9660 100644 --- a/libftasm/src/lst/ft_lsteadd.c +++ b/libftasm/src/lst/ft_lsteadd.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 14:57:17 by jhalford #+# #+# */ -/* Updated: 2016/11/04 13:11:05 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 15:37:23 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libftasm/src/lst/ft_lstnew.c b/libftasm/src/lst/ft_lstnew.c index 2b5a45ec..e85e8c62 100644 --- a/libftasm/src/lst/ft_lstnew.c +++ b/libftasm/src/lst/ft_lstnew.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/29 15:57:38 by jhalford #+# #+# */ -/* Updated: 2017/03/08 00:21:44 by ariard ### ########.fr */ +/* Updated: 2017/03/13 15:41:27 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libftasm/src/str/ft_str3join.c b/libftasm/src/str/ft_str3join.c index 81bb69dc..91384cbc 100644 --- a/libftasm/src/str/ft_str3join.c +++ b/libftasm/src/str/ft_str3join.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/03 18:03:26 by jhalford #+# #+# */ -/* Updated: 2016/11/03 18:03:26 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 16:07:24 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/libftasm/src/str/ft_strcpy.c b/libftasm/src/str/ft_strcpy.c index 64176338..63ee8897 100644 --- a/libftasm/src/str/ft_strcpy.c +++ b/libftasm/src/str/ft_strcpy.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/07 10:48:12 by jhalford #+# #+# */ -/* Updated: 2016/12/07 15:23:05 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 16:06:49 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,7 +17,7 @@ char *ft_strcpy(char *dst, const char *src) int i; i = 0; - while (src[i]) + while (src && src[i]) { dst[i] = src[i]; i++;