- 120541 : improper use of nagative value
Change-Id: Ic93d890a08def810a8f09ed6bbb8171e440438df
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
BIO *bio = BIO_new(BIO_s_mem());
ERR_print_errors(bio);
char *buf = NULL;
- size_t len = BIO_get_mem_data(bio, &buf);
+ long len = BIO_get_mem_data(bio, &buf);
+ if(len < 0) {
+ LogError("Fail in BIO_get_mem_data()");
+ return;
+ }
+ size_t length = static_cast<size_t>(len);
BIO_free(bio);
- std::string ret(buf, len);
+ std::string ret(buf, length);
free(buf);
LogError(ret);
}
}
-} // namespace CKM
\ No newline at end of file
+} // namespace CKM