Open Source Telephony
 help / color / mirror / Atom feed
From: Andreas WESTIN <andreas.westin@stericsson.com>
To: ofono@ofono.org
Subject: Re: [PATCH 1/1] src: out of bounds problem in smsutil
Date: Wed, 16 Feb 2011 17:13:12 +0100	[thread overview]
Message-ID: <4D5BF798.3070003@stericsson.com> (raw)
In-Reply-To: <4D5BF532.7080701@gmail.com>

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

Hi,

>> Valgrind complains that we step outside the allocated memory by 1 byte
>> since we loop the string with:
>>
>> while (*topics != '\0')
>>
>> the allocated memory is the size of the string and any \0 ends up
>> outside. At least that's my interpretation.
>>
>
> It might be your loop is actually going past the end, not that the
> terminating NULL is not within bounds returned from
> cbs_topic_ranges_to_string.  If the original code was wrong then we
> should be seeing valgrind report errors on the cbs code used in
> unit/test-sms.c.  I'm not seeing this at all.

Yes you absolutely correct, we step it an extra time in one case.

Please disregard the patch.

Regards
Andreas

      reply	other threads:[~2011-02-16 16:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 12:04 [PATCH 1/1] src: out of bounds problem in smsutil Jessica Nilsson
2011-02-16 15:25 ` Denis Kenzior
2011-02-16 15:50   ` Andreas WESTIN
2011-02-16 16:02     ` Denis Kenzior
2011-02-16 16:13       ` Andreas WESTIN [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=4D5BF798.3070003@stericsson.com \
    --to=andreas.westin@stericsson.com \
    --cc=ofono@ofono.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox