On Fri, Apr 12, 2002 at 07:12:53PM +0530, Philip S Tellis spoke out thus:
On Fri, 12 Apr 2002, Varun Varma wrote:
Q: How do we know that str2, str3...really are strings concat with other strings. Could they be pointes to structures, or perhaps arbitary/binary memory buffers?
second parameter to MD5_Update is a string, and third parameter is the length of the string.
Isn't it supposed to be void *? Even if it is unsigned char *, the values being passed might be a typecasted struct.
Question is, do you know by knowledge that these are supposed to be strings, or is that based obversing output from ltrace?
Here, I assume that when you say string, you are refering to an ASCIIZ string, not a binary string - strlen et al.
yes, although it need not be zero terminated. The string length is passed as third parameter, and need not always be the same as the actual length of the string.
strlen won't work on anything but null terminated strings. You've show using strlen as the third parameter, and that won't work unless one assumes that there are good old \0 terminated strings. Unless, you put in strlen symbolically, rather than syntatically, i.e. to show the length of the data in parameter 2 should be passed as parameter 3.
Regards, -Varun