Fix Potential DAN sccp.c - #23802
Open
Ti-Mis wants to merge 1 commit into
Open
Fix Potential DAN sccp.c#23802Ti-Mis wants to merge 1 commit into
Ti-Mis wants to merge 1 commit into
Conversation
Fix: Deref After Null (Potential problem)
Problem:
if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) {
op2 is obtained from get_op2_value(). Under certain conditions, when opline->op2_type != IS_CONST and ssa_op->op2_use == -1, get_op2_value() may return NULL.
The subsequent SKIP_IF_TOP(op2) check appears to handle IS_TOP(op2), but does not explicitly check whether op2 is NULL. As a result, it seems possible for ct_eval_fetch_obj() to be called with a NULL op2.
Inside ct_eval_fetch_obj(), op2 is subsequently passed to fetch_obj_prop(), where it may be dereferenced without a NULL check.
Solution :The issue can be fixed by adding a check for the op2 variable.
Signed-off-by: t.mishin@fobos-nt.ru
Signed-off-by: crystarm@altlinux.org
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Deref After Null (Potential problem)
Problem:
if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) {
op2 is obtained from get_op2_value(). Under certain conditions, when opline->op2_type != IS_CONST and ssa_op->op2_use == -1, get_op2_value() may return NULL.
The subsequent SKIP_IF_TOP(op2) check appears to handle IS_TOP(op2), but does not explicitly check whether op2 is NULL. As a result, it seems possible for ct_eval_fetch_obj() to be called with a NULL op2.
Inside ct_eval_fetch_obj(), op2 is subsequently passed to fetch_obj_prop(), where it may be dereferenced without a NULL check. Solution :The issue can be fixed by adding a check for the op2 variable. Signed-off-by: t.mishin@fobos-nt.ru
Signed-off-by: crystarm@altlinux.org