git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] vcs-svn: Start working on the dumpfile producer

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jan 15, 2011, 08:11 UTC
Message-ID
<20110115081128.GB9277@kytes>
In-Reply-To
<20110115073925.GA21744@m62s10.vlinux.de>
Hi Peter,
Peter Baumann writes:
Show 14 quoted lines
> > +	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
Previous: Peter BaumannNext: Ramkumar Ramachandra
Message 5 of 8 in “Towards a Git-to-SVN bridge”
  1. 0/3 Towards a Git-to-SVN bridgeRamkumar Ramachandra, Jan 15, 2011
  2. 1/3 date: Expose the time_to_tm functionRamkumar Ramachandra, Jan 15, 2011
  3. 2/3 vcs-svn: Start working on the dumpfile producerRamkumar Ramachandra, Jan 15, 2011
  4. Peter BaumannJan 15, 2011
  5. Ramkumar RamachandraJan 15, 2011
  6. 3/3 Build an svn-fi target in contrib/svn-feRamkumar Ramachandra, Jan 15, 2011
  7. Jonathan NiederJan 15, 2011
  8. Ramkumar RamachandraJan 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.