diff --git a/src/util.cpp b/src/util.cpp
index a524922..01e1165 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -3232,7 +3232,7 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl,
   // all arguments.
   ArgumentListIterator srcAli(*srcAl),dstAli(*dstAl);
   Argument *srcA,*dstA;
-  for (;(srcA=srcAli.current(),dstA=dstAli.current());++srcAli,++dstAli)
+  for (;(srcA=srcAli.current(),srcA && dstA=dstAli.current());++srcAli,++dstAli)
   { 
     if (!matchArgument(srcA,dstA,className,namespaceName,
           usingNamespaces,usingClasses))
