Merge r1685339 from trunk. Follow up to 2.4.x's r1684515. Follow up to r1684513: apply missing changes voted on security@. Submitted by: minfrin, ylavic Reviewed by: ylavic, wrowe, jim Reported by: regilero <regis.leroy makina-corpus.com>