dgibson / dtc

Device Tree Compiler
235 stars 134 forks source link

A possible case to hang the compiler #64

Closed Escapingbug closed 1 year ago

Escapingbug commented 2 years ago
/dts-v1/;

/ {
    clocks = <&ref &ref>;

    ref: poc {
        phandle = <1>;
        #clock-cells = <0xffffffff>;
    };
};

During checks, in function check_property_phandle_args, the 0xffffffff value could trigger an integer overflow which will keep us in the loop forever.

dgibson commented 2 years ago

Thanks for the report. Sorry it's taken me so long to look at it. Certainly looks like a bug, I've made an automated test case and I'm investigating now.

dgibson commented 2 years ago

Ok, I've applied a fix, it would be great if you can check it.

dgibson commented 1 year ago

Closing, since there's been no response.