<div dir="ltr"><div class="gmail_default" style="font-size:small">Hello,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Please ignore this patch.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks,</div><div class="gmail_default" style="font-size:small">Niteesh.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 3, 2021 at 3:14 PM G S Niteesh Babu <<a href="mailto:niteesh.gs@gmail.com">niteesh.gs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Fixed use after free and null pointer dereference defects<br>
<br>
FIXES:<br>
1) CID 1472601 (NULL_RETURNS)<br>
2) CID 1472600 (USE_AFTER_FREE)<br>
3) CID 1472599 (USE_AFTER_FREE)<br>
4) CID 1472598 (USE_AFTER_FREE)<br>
5) CID 1472596 (USE_AFTER_FREE)<br>
6) CID 1472597 (ARRAY_VS_SINGLETON)<br>
7) CID 1472595 (ARRAY_VS_SINGLETON)<br>
---<br>
bsps/shared/ofw/ofw.c | 14 +++++++-------<br>
1 file changed, 7 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/bsps/shared/ofw/ofw.c b/bsps/shared/ofw/ofw.c<br>
index 82924b2600..126a86cc55 100644<br>
--- a/bsps/shared/ofw/ofw.c<br>
+++ b/bsps/shared/ofw/ofw.c<br>
@@ -313,7 +313,7 @@ ssize_t rtems_ofw_get_prop_alloc(<br>
}<br>
<br>
if (rtems_ofw_get_prop(node, propname, *buf, len) == -1) {<br>
- rtems_ofw_free(buf);<br>
+ rtems_ofw_free(*buf);<br>
*buf = NULL;<br>
return -1;<br>
}<br>
@@ -344,7 +344,7 @@ ssize_t rtems_ofw_get_prop_alloc_multi(<br>
}<br>
<br>
if (rtems_ofw_get_prop(node, propname, *buf, len) == -1) {<br>
- rtems_ofw_free(buf);<br>
+ rtems_ofw_free(*buf);<br>
*buf = NULL;<br>
return -1;<br>
}<br>
@@ -373,7 +373,7 @@ ssize_t rtems_ofw_get_enc_prop_alloc(<br>
}<br>
<br>
if (rtems_ofw_get_enc_prop(node, propname, *buf, len) == -1) {<br>
- rtems_ofw_free(buf);<br>
+ rtems_ofw_free(*buf);<br>
*buf = NULL;<br>
return -1;<br>
}<br>
@@ -404,7 +404,7 @@ ssize_t rtems_ofw_get_enc_prop_alloc_multi(<br>
}<br>
<br>
if (rtems_ofw_get_enc_prop(node, propname, *buf, len) == -1) {<br>
- rtems_ofw_free(buf);<br>
+ rtems_ofw_free(*buf);<br>
*buf = NULL;<br>
return -1;<br>
}<br>
@@ -500,7 +500,7 @@ static phandle_t rtems_ofw_get_effective_phandle(<br>
)<br>
{<br>
phandle_t child;<br>
- phandle_t ref;<br>
+ phandle_t ref[1];<br>
<br>
for (child = rtems_ofw_child(node); child != 0; child = rtems_ofw_peer(child)) {<br>
ref = rtems_ofw_get_effective_phandle(child, xref);<br>
@@ -533,7 +533,7 @@ phandle_t rtems_ofw_node_from_xref( phandle_t xref )<br>
<br>
phandle_t rtems_ofw_xref_from_node( phandle_t node )<br>
{<br>
- phandle_t ref;<br>
+ phandle_t ref[1];<br>
<br>
if (rtems_ofw_get_enc_prop(node, "phandle", &ref, sizeof(ref)) == -1 &&<br>
rtems_ofw_get_enc_prop(node, "ibm,phandle", &ref, sizeof(ref)) == -1 &&<br>
@@ -614,7 +614,7 @@ int rtems_ofw_get_reg(<br>
offset = rtems_fdt_phandle_to_offset(parent);<br>
ptr = fdt_getprop(fdtp, offset, "ranges", &len);<br>
<br>
- if (len < 0) {<br>
+ if (ptr == NULL) {<br>
break;<br>
}<br>
<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div>