You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function writes into a global variable m_userdata. Consequently, if the application invokes ndn_sig_verifier_verify_data with a new Data packet before the previous validation has completed, undefined behavior may occur.
Introduce a ndn_sig_verifier_verify_data_r function that accepts a context argument to carry per-validation state, to be used in place of the global variable(s). The calling application is responsible for allocating memory (either statically or dynamically) for the context struct.
Implement ndn_sig_verifier_verify_data as a wrapper of ndn_sig_verifier_verify_data that uses global variable or function-scope static variable as context.
Update the documentation of ndn_sig_verifier_verify_data to note the non-reentrancy limitation.
The text was updated successfully, but these errors were encountered:
The function writes into a global variable
m_userdata
. Consequently, if the application invokesndn_sig_verifier_verify_data
with a new Data packet before the previous validation has completed, undefined behavior may occur.ndn-lite/app-support/ndn-sig-verifier.c
Lines 30 to 32 in 6d433ac
ndn-lite/app-support/ndn-sig-verifier.c
Lines 330 to 333 in 6d433ac
To solve this issue:
ndn_sig_verifier_verify_data_r
function that accepts a context argument to carry per-validation state, to be used in place of the global variable(s). The calling application is responsible for allocating memory (either statically or dynamically) for the context struct.ndn_sig_verifier_verify_data
as a wrapper ofndn_sig_verifier_verify_data
that uses global variable or function-scope static variable as context.ndn_sig_verifier_verify_data
to note the non-reentrancy limitation.The text was updated successfully, but these errors were encountered: