In util/support/utf8_conv.c, the SWAP16 macro is invoked with an
authorTom Yu <tlyu@mit.edu>
Wed, 13 May 2009 20:41:37 +0000 (20:41 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 13 May 2009 20:41:37 +0000 (20:41 +0000)
commit9c6c6de0ac5b08c31585350309cb85964b8e01e1
tree2f49741a8c446eb83b37d7bdc878572af4bc0184
parent99c9aee7bf69d5ede590afbd00e59f41bd2d0114
In util/support/utf8_conv.c, the SWAP16 macro is invoked with an
argument that has side effects.  On platforms where SWAP16 can
evaluate its argument twice (including platforms where utf8_conv.c
creates a fallback definition for the SWAP16 macro), this can cause a
read overrun by a factor of two.

Rearrange the data flow to avoid calling SWAP16 with an argument that
has side effects.

ticket: 6486
tags: pullup
target_version: 1.7

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22348 dc483132-0cff-0310-8789-dd5450dbe970
src/util/support/utf8_conv.c