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

Danger of dereferencing null pointer

From: Dirk Hoffmann <dh.discuss_at_web.de>
Date: 2004-10-12 16:09:55 CEST


when I was looking at subversion/clients/cmdline/util.c to comprehend
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)


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 Tue Oct 12 16:10:15 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.