keygen-sh / example-cpp-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using C++, OpenSSL, Ed25519 and AES-256-GCM.
https://keygen.sh
MIT License
9 stars 8 forks source link

Buffer overflow(?) #2

Closed nkallen closed 11 months ago

nkallen commented 1 year ago

https://github.com/keygen-sh/example-cpp-cryptographic-license-files/blob/30682baebd4897ac1f27350aefbc4b648aa66db5/main.cpp#L173

I think the string isn't null terminated so this is a potential buffer overflow. there's an alternative ctor

std::string str(dec, dec + size);

ezekg commented 11 months ago

Fixed in https://github.com/keygen-sh/example-cpp-cryptographic-license-files/commit/2ebc95e071a7999b46d96e39462b9283e754f06d.