On Thu, May 28, 2009 at 11:51:42AM +0200, Ger Hobbelt wrote:
> This is a classic/basic 'C' programming mistake you made, not an OpenSSL one:
>
> pointers are not arrays are not strings ;-)
>
> sizeof(buf) == ?
>
> buf is of type 'char *' and therefore sizeof(buf) == sizeof(char *)
> which is probably 4 or 8, depending on what platform you build this
> for.
> If you wish to provide the length of the C string data, pointed at by
> pointer 'buf', then strlen() is your man:
>
> either
>
> BIO_puts(b, buf) -- which does this internally
>
> or
>
> BIO_write(b, buf, strlen(buf))
Only if the data is text. Using strlen() on binary data is another
classic/basic 'C' programming mistake.
--
Viktor.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [email protected]