lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130830134325.51DC83E102A@localhost>
Date:	Fri, 30 Aug 2013 14:43:25 +0100
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Roy Franz <roy.franz@...aro.org>, linux-kernel@...r.kernel.org,
	linux-efi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	matt.fleming@...el.com, linux@....linux.org.uk
Cc:	leif.lindholm@...aro.org, dave.martin@....com, msalter@...hat.com,
	Roy Franz <roy.franz@...aro.org>
Subject: Re: [PATCH 14/16] Add strstr to compressed string.c for ARM.

On Fri,  9 Aug 2013 16:26:15 -0700, Roy Franz <roy.franz@...aro.org> wrote:
> The shared efi-stub-helper.c functions require a strstr
> implementation.
> Implementation copied from arch/x86/boot/string.c
> 
> Signed-off-by: Roy Franz <roy.franz@...aro.org>

Okay, but at some point arch/arm/boot/compressed/string.c should be
reworked into a common place.

Reviewed-by: Grant Likely <grant.likely@...aro.org>

> ---
>  arch/arm/boot/compressed/string.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c
> index 36e53ef..5397792 100644
> --- a/arch/arm/boot/compressed/string.c
> +++ b/arch/arm/boot/compressed/string.c
> @@ -111,6 +111,27 @@ char *strchr(const char *s, int c)
>  	return (char *)s;
>  }
>  
> +/**
> + * strstr - Find the first substring in a %NUL terminated string
> + * @s1: The string to be searched
> + * @s2: The string to search for
> + */
> +char *strstr(const char *s1, const char *s2)
> +{
> +	size_t l1, l2;
> +
> +	l2 = strlen(s2);
> +	if (!l2)
> +		return (char *)s1;
> +	l1 = strlen(s1);
> +	while (l1 >= l2) {
> +		l1--;
> +		if (!memcmp(s1, s2, l2))
> +			return (char *)s1;
> +		s1++;
> +	}
> +	return NULL;
> +}
>  #undef memset
>  
>  void *memset(void *s, int c, size_t count)
> -- 
> 1.7.10.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ