[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Some statements whose value is ignored in SRL



Bruce,

I believe you are correct in both of these findings.  Obviously the '*'
is useless since we are de-referencing pointers but not doing anything
with the values.  The second one is particularly troublesome because the
decodedLen pointer will now point to the wrong chunk of memory.  So I
agree it should be arithmetic on the de-referenced value, not on the
pointer itself.

Thank you for finding this, we will take note of it and make sure it is
corrected in our next patch or release.

Regards,

Dave Abarbanel
BAE Systems

-----Original Message-----
From: owner-imc-cml@xxxxxxxxxxxx [mailto:owner-imc-cml@xxxxxxxxxxxx] On
Behalf Of Bruce Stephens
Sent: Monday, February 05, 2007 8:05 AM
To: imc-cml@xxxxxxx
Subject: Some statements whose value is ignored in SRL


I've been compiling CML with -Wall, just to see what messages come
out.

There are some lines of the form

      *ptr++;

For example in, SRL_Mgr.c, but they look fine: they look as though
they're supposed to be just ptr++:

		// If this character matches one of the delimiters, then
break out of
		// the loop
		if (*pDelim != '\0')
			break;
		*end ++;
		len++;
	}
	*end++;
	return end;

There's one in SRL_ldap.c (line 2401) that looks like it may be a bug:

   if( (tagId1 == EOC_TAG_ID) && (elmtLen1 == INDEFINITE_LEN))
   {
      if(*asndata++ == 0)
      {
         *decodedLen++;   /* read one byte above */
         return(SRL_SUCCESS); /* got EOC so can exit this SET OF/SEQ
OF's for loop*/
      }
      else

That one's intended to be (*decodedLen)++, or ++*decodedLen, isn't it?