All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH 1/2] util: Add suffix check for a string
Date: Mon, 25 Apr 2016 12:36:32 -0500	[thread overview]
Message-ID: <571E55A0.2080605@gmail.com> (raw)
In-Reply-To: <alpine.OSX.2.20.1604250914100.1671@mjmartin-mac01.local>

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

Hi Tim,

 >> +
>> +    str_len_diff = strlen(str) - strlen(suffix);
>
> strlen returns size_t (unsigned), which is a 64-bit type on 64-bit
> platforms. Hopefully no one is throwing around 4+GB null-terminated
> strings, but you never know. You can make sure the suffix is shorter
> before calculating the difference, avoiding signed integers altogether.

+1.  Please fix/resubmit this one.

Regards,
-Denis

      reply	other threads:[~2016-04-25 17:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 22:06 [PATCH 1/2] util: Add suffix check for a string Tim Kourt
2016-04-22 22:06 ` [PATCH 2/2] unit: Add tests for the " Tim Kourt
2016-04-25 16:16 ` [PATCH 1/2] util: Add " Mat Martineau
2016-04-25 17:36   ` Denis Kenzior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=571E55A0.2080605@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ell@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.