> The std:string crash does not happen on OSX/iOS. It also doesn't happen 
on android until
> I use Crypto++ with std::strings.
> Meanwhile, on all platforms, QString/QByteArray does not seem to "play 
nice" with Crypto++.
> QString when using constData() function just returns the .constData() 
toUtf8() byte
> array. I've used Qt's classes extensively and never had this issue. Does 
anyone know 
> what is going on?


This has earmarks of memory issues tied to low-level component 
incompatibility. Is the GNU C++ runtime being mixed with the STLport 
runtime? That is, do you know what Qt is using by default? If runtimes are 
being mixed and matched, then its one of the first things I would change.

I would also look at C++03 versus C++11.

> Very weird things happen, like nulls being missed (QByteArray places a 
null at the end
> in most cases).

This does not sound right (to me). I would expect a QString to have the 
NULL and perhaps perform the UTF-8 conversion. But I would not expect it 
from QByteArray, which should be closer to a std::vector.

Also, you can't modify things through a const-pointer. That's undefined 
behavior, IIRC. For the case of a std::string, that usually means you get 
the non-const pointer via &str[0]. I don't know what QString offers, but 
you might need to do the same.

Jeff

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to