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]
Date: Wed, 14 Feb 2024 19:03:10 -0300
From: Rodrigo Campos <rodrigo@...g.com.ar>
To: Willy Tarreau <w@....eu>
Cc: Thomas Weißschuh <linux@...ssschuh.net>,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] tools/nolibc: Fix strlcat() return code and size
 usage

On 2/14/24 16:34, Rodrigo Campos wrote:
> size_t strlcat_rata(char *dst, const char *src, size_t size)
> {
>          const char *orig_src = src;
>          size_t len = 0;
>          for (;len < size; len++) {
>                  if (dst[len] == '\0')
>                          break;
>          }

If you think about it, this is strnlen() and what follows is strncat().

> size_t strlcat_willy_fixed(char *dst, const char *src, size_t size)
> {
>          const char *orig_src = src;
>          size_t len = strlen(dst);
>          if (size < len)
>                  len = size;

Same here.

We can simplify the code by using them, but the size doesn't seem to be 
smaller. Let me see what I can do.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ