Skip to content

Commit

Permalink
refactor: Replace sscanf with strtol for the security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ajblane committed May 6, 2019
1 parent 1fc0f18 commit 333196f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/remote_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int main(int argc, char const *const *argv)
/* Message body format: transacton | mwm */
memcpy(trytes, envelope.message.body.bytes, TRANSACTION_TRYTES_LENGTH);
memcpy(buf, envelope.message.body.bytes + TRANSACTION_TRYTES_LENGTH, 4);
sscanf(buf, "%d", &mwm);
mwm = strtol(buf, NULL, 10);

#if defined(ENABLE_DEBUG)
printf(MSG_PREFIX "Doing PoW with mwm = %d...\n", mwm);
Expand Down

0 comments on commit 333196f

Please sign in to comment.