[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

vdelta demo

From: Malcolm Smith <mjfreelancing_at_optusnet.com.au>
Date: 2002-01-09 10:52:41 CET

Ok, I found the problem.

In the vdelta-test project there are these lines:

  apr_initialize();
  svn_txdelta (&stream,
               svn_stream_from_stdio (source_file, NULL),
               svn_stream_from_stdio (target_file, NULL),
               NULL);

Why is NULL passed as the paramater for the pool. The call to
svn_stream_from_stdio() is where the problem begins:

There is no check on a valid pool.

so when the line:

  baton = apr_palloc (pool, sizeof (*baton));

is called BANG.

svn_stream_t *svn_stream_from_stdio (FILE *fp, apr_pool_t *pool)
{
  struct baton_stdio *baton;
  svn_stream_t *stream;

  if (fp == NULL)
    return svn_stream_empty (pool);
  baton = apr_palloc (pool, sizeof (*baton));
  baton->fp = fp;
  baton->pool = pool;
  stream = svn_stream_create (baton, pool);
  svn_stream_set_read (stream, read_handler_stdio);
  svn_stream_set_write (stream, write_handler_stdio);
  return stream;
}

So what's the remedy here.

Thanks

Malcolm

Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com

CORintel
ABN: 30 336 110 329
Received on Sat Oct 21 14:36:55 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.