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

Dereferencing of null pointer possible?

From: Dirk Hoffmann <dh.discuss_at_web.de>
Date: 2004-10-12 12:11:59 CEST

Hi,

when I was looking at subversion/clients/cmdline/util.c to understand
commit items I found the following lines of code:

  if (! (commit_items || commit_items->nelts))
    {
      *log_msg = "";
      return SVN_NO_ERROR;
    }

I believe the first line should be

if (!commit_items || !commit_items->nelts)

or

if (! (commit_items && commit_items->nelts) )

Otherwise if commit_item is NULL it will be dereferenced.

Regards Dirk

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 13 01:12:20 2004

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.