[gnutls-devel] GnuTLS | Two integer overflows in priority.c (#679)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Wed Jan 23 15:58:30 CET 2019

To convince you :-) ...

The macro contained a loop over all items beginning at the current position of the main loop. (And I can not see how a compiler could optimize that out.)

Example: With N being `priority_cache->protocol.num_priorities`, the 'macro loop's body will be executed N+(N-1)+(N-2)+... times. This is sum(1..N) which is (N^2+N)/2.

The new approach uses exactly N executions of the loop body.

With N=10 this is 55 against 10.

Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/issues/679#note_134173437
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20190123/23464783/attachment.html>

More information about the Gnutls-devel mailing list