Summary: | Potential null pointer dereference in mem_word_get_bits_rectangle(gdevmem.c) | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | ruc.iser |
Component: | Graphics Library | Assignee: | Default assignee <ghostpdl-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | master | ||
Hardware: | PC | ||
OS: | Linux | ||
Customer: | Word Size: | --- |
Description
ruc.iser
2017-06-18 23:46:34 UTC
mem_word_get_bits_rectangle() is a 'wrapper' for get_bits_rectangle and simply gets the bits using words. Since get_bits_rectangle() checks line_ptrs there is no need for mem_word_get_bits_rectangle() to do so. (In reply to Ken Sharp from comment #1) > mem_word_get_bits_rectangle() is a 'wrapper' for get_bits_rectangle and > simply gets the bits using words. Since get_bits_rectangle() checks > line_ptrs there is no need for mem_word_get_bits_rectangle() to do so. But in this 'wrapper' function, the access to line_ptrs is before calling get_bits_rectangle(). Can the checking in get_bits_rectangle() protect the dereference in the 'wrapper'? (In reply to ruc.iser from comment #2) > But in this 'wrapper' function, the access to line_ptrs is before calling > get_bits_rectangle(). Can the checking in get_bits_rectangle() protect the > dereference in the 'wrapper'? OK that's a fair point, but can you please put this kind of explanation of the problem in the report? Not simply put a (C++) comment in the copied code, that's much too easy to miss. (In reply to Ken Sharp from comment #3) > (In reply to ruc.iser from comment #2) > > > But in this 'wrapper' function, the access to line_ptrs is before calling > > get_bits_rectangle(). Can the checking in get_bits_rectangle() protect the > > dereference in the 'wrapper'? > > OK that's a fair point, but can you please put this kind of explanation of > the problem in the report? > > Not simply put a (C++) comment in the copied code, that's much too easy to > miss. Ok. We did not make the report clear enough, it's out fault. We'll pay attention to that in the future. (In reply to Ken Sharp from comment #3) > (In reply to ruc.iser from comment #2) > > > But in this 'wrapper' function, the access to line_ptrs is before calling > > get_bits_rectangle(). Can the checking in get_bits_rectangle() protect the > > dereference in the 'wrapper'? > > OK that's a fair point, but can you please put this kind of explanation of > the problem in the report? > > Not simply put a (C++) comment in the copied code, that's much too easy to > miss. So should we resubmit a report for this problem to make the explanation clearer? (In reply to ruc.iser from comment #5) > (In reply to Ken Sharp from comment #3) > > (In reply to ruc.iser from comment #2) > > > > > But in this 'wrapper' function, the access to line_ptrs is before calling > > > get_bits_rectangle(). Can the checking in get_bits_rectangle() protect the > > > dereference in the 'wrapper'? > > > > OK that's a fair point, but can you please put this kind of explanation of > > the problem in the report? > > > > Not simply put a (C++) comment in the copied code, that's much too easy to > > miss. > > So should we resubmit a report for this problem to make the explanation > clearer? No, that's OK, I changed the status back to unconfirmed from resolved. I understand your point now. I have a patch ready to commit, just waiting on review. *** Bug 698078 has been marked as a duplicate of this bug. *** |