All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Odd git overrflow bug?
Date: Sun, 10 Jul 2016 14:21:05 -0700	[thread overview]
Message-ID: <CA+55aFwvZqqSkphgL+UBqfXnSGAFEzmqyH83OMGnpco3ZVZUnA@mail.gmail.com> (raw)
In-Reply-To: <CA+55aFymKO5Bi2qZ-zaiZKQAk7RxusEMJ9Y0Gw6ywdznK+TaRQ@mail.gmail.com>

On Sun, Jul 10, 2016 at 2:05 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> I'm getting "extra" being -1 in strbuf_grow(). Let me dog deeper.

"dog deeper"? My typing skills are deteriorating.

Anyway, I dug deeper, and the reason is that "tabwidth" is -1, and then

 pretty.c:1669: strbuf_add_tabexpand():

        strbuf_addchars(sb, ' ', tabwidth - (width % tabwidth));

ends up having the number be -1.

I'm not sure why it doesn't happen in current git master, because that
function is the same, and the logic around expand_tabs_in_log looks
similar too.

That all came from

    fe37a9c586a6 (:pretty: allow tweaking tabwidth in --expand-tabs")

and I suspect the code just needs to protect against negative or zero,
rather than just zero.

Junio?

              Linus

  reply	other threads:[~2016-07-10 21:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-10 16:02 Odd git overrflow bug? Linus Torvalds
2016-07-10 18:41 ` Andreas Schwab
2016-07-10 21:01   ` Linus Torvalds
2016-07-10 21:05     ` Linus Torvalds
2016-07-10 21:21       ` Linus Torvalds [this message]
2016-07-10 21:29         ` Linus Torvalds
2016-07-10 21:52           ` Junio C Hamano

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=CA+55aFwvZqqSkphgL+UBqfXnSGAFEzmqyH83OMGnpco3ZVZUnA@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=schwab@linux-m68k.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.