On 14.09.2020 13:19, Trammell Hudson wrote: > On Monday, September 14, 2020 6:06 AM, Roger Pau Monné <roger....@citrix.com> > wrote: >> On Mon, Sep 07, 2020 at 03:00:26PM -0400, Trammell Hudson wrote: >>> - file->ptr = (void *)pe_find_section(image->ImageBase, image->ImageSize, >> >> This already returns a void *, so there's no need for the cast. > > It returns const void *, but file has a non-const pointer. Perhaps files > should > be immutable and that could be addressed in a const-correctness patch series.
But casting away const-ness is really bad. If file->ptr can't be adjusted accordingly, I'm afraid the function will need to return a pointer to non-const for the time being. Jan