From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Peter Baumann <waste.manager@gmx.de>
Cc: Git List <git@vger.kernel.org>,
Jonathan Nieder <jrnieder@gmail.com>,
David Barr <david.barr@cordelta.com>,
Sverre Rabbelier <srabbelier@gmail.com>
Subject: Re: [PATCH 2/3] vcs-svn: Start working on the dumpfile producer
Date: Sat, 15 Jan 2011 13:41:30 +0530 [thread overview]
Message-ID: <20110115081128.GB9277@kytes> (raw)
In-Reply-To: <20110115073925.GA21744@m62s10.vlinux.de>
Hi Peter,
Peter Baumann writes:
> > + while ((t = buffer_read_line(&input))) {
> > + val = strchr(t, ' ');
> > + if (!val) {
> > + if (!memcmp(t, "blob", 4))
> > + active_ctx = BLOB_CTX;
> > + else if (!memcmp(t, "deleteall", 9))
> > + ;
> > + continue;
>
> Having actually no idea what the input you are reading from might look like, but
> seeing those two memcmp compares above makes me wonder if 't' might ever be smaller
> than 4 (or 9 for the else part). Which obviously would lead to a SEGFAULT.
> In the code below there are also memcmp class which might step out of the
> buffer.
Right. Silly mistake on my part. Thanks for pointing it out.
There are probably many more trivial mistakes- I was in a hurry to get
/something/ working, and didn't have a chance to clean up the code.
-- Ram
next prev parent reply other threads:[~2011-01-15 8:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-15 6:51 [RFC PATCH 0/3] Towards a Git-to-SVN bridge Ramkumar Ramachandra
2011-01-15 6:51 ` [PATCH 1/3] date: Expose the time_to_tm function Ramkumar Ramachandra
2011-01-15 6:51 ` [PATCH 2/3] vcs-svn: Start working on the dumpfile producer Ramkumar Ramachandra
2011-01-15 7:39 ` Peter Baumann
2011-01-15 8:11 ` Ramkumar Ramachandra [this message]
2011-01-15 6:51 ` [PATCH 3/3] Build an svn-fi target in contrib/svn-fe Ramkumar Ramachandra
2011-01-15 7:22 ` [RFC PATCH 0/3] Towards a Git-to-SVN bridge Jonathan Nieder
2011-01-15 7:43 ` Ramkumar Ramachandra
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=20110115081128.GB9277@kytes \
--to=artagnon@gmail.com \
--cc=david.barr@cordelta.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=srabbelier@gmail.com \
--cc=waste.manager@gmx.de \
/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;
as well as URLs for NNTP newsgroup(s).