Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3f29cbb

Browse filesBrowse files
posix4eMylesBorins
authored andcommitted
src: fix string format mistake for 32 bit node
warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘unsigned int’ [-Wformat=] BIO_printf(bio, "0x%lx", exponent_word); PR-URL: #10082 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent f412b1f commit 3f29cbb
Copy full SHA for 3f29cbb

File tree

Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-3
lines changed
Open diff view settings
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,9 +1457,14 @@ static Local<Object> X509ToObject(Environment* env, X509* cert) {
14571457
String::kNormalString, mem->length));
14581458
(void) BIO_reset(bio);
14591459

1460-
BN_ULONG exponent_word = BN_get_word(rsa->e);
1461-
BIO_printf(bio, "0x%lx", exponent_word);
1462-
1460+
uint64_t exponent_word = static_cast<uint64_t>(BN_get_word(rsa->e));
1461+
uint32_t lo = static_cast<uint32_t>(exponent_word);
1462+
uint32_t hi = static_cast<uint32_t>(exponent_word >> 32);
1463+
if (hi == 0) {
1464+
BIO_printf(bio, "0x%x", lo);
1465+
} else {
1466+
BIO_printf(bio, "0x%x%08x", hi, lo);
1467+
}
14631468
BIO_get_mem_ptr(bio, &mem);
14641469
info->Set(env->exponent_string(),
14651470
String::NewFromUtf8(env->isolate(), mem->data,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.