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
You can see that tout_start, tout_end, cout_start, cout_end variables are not initialized before they are used. However, after evaluating the control flow, I do not see a security issue.
if (tout_end==tout_start) {
// Nothing queued for target, so read from clientFD_SET(client, &rlist);
} else {
// Data queued for target, so write to itFD_SET(target, &wlist);
}
if (cout_end==cout_start) {
// Nothing queued for client, so read from targetFD_SET(target, &rlist);
} else {
// Data queued for client, so write to itFD_SET(client, &wlist);
}
But, this is not recommended in Secure Coding practices.
The issue can be depicted by below given dummy C snippet.
WebSockify Bug Report - Project Srishti
While looking at
websockify.c
inwebsockify/other
, I noticed an obviousUse of Uninitialized Variable
bug.You can see that
tout_start
,tout_end
,cout_start
,cout_end
variables are not initialized before they are used. However, after evaluating the control flow, I do not see a security issue.But, this is not recommended in Secure Coding practices.
The issue can be depicted by below given dummy C snippet.
dummy.c
Output
From the output, you can observe that the value of
tout_start
,tout_end
,cout_start
,cout_end
variables differ each run.Recommendation
Initialize the variables with a concrete value.
Credits
Ashfaq Ansari - Project Srishti
The text was updated successfully, but these errors were encountered: