The detection of overlapping sprintf calls has a limitation that leads to both false positives (PR 102919) and negatives (PR 102238) in corner cases involving members of aggregates. The false positives result from the overlap logic not using the size of the member used as an argument to %s to constrain the length of the directive output. The false negatives are due to the logic failing to determine the identity of a member from the address or reference to the enclosing object and an offset. The attached patch improves the detection logic to handle both sets of cases. In addition, it moves the utility functions used to implement the logic from the sprintf pass into pointer-query where they can be used for other purposes in the future (my work in progress). Tested on x86_64-linux and by building Glibc and verifying it doesn't cause any new warnings, Martin