diff options
author | Tor Lillqvist <tml@collabora.com> | 2013-09-04 00:40:46 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2013-09-04 00:40:46 +0300 |
commit | a463f74ebf9a2d415f645d4d81377f0207216324 (patch) | |
tree | 6127e2923bbaf5fdde7f96cb4088b4f3bca8c4cd /embedserv | |
parent | 9c0ba0ba41cb3b814cc8bf7a33abf1245d4b241e (diff) |
WaE: C4723: potential divide by 0
Fix crack that formats an int into eight hex digits. Why the simple
sprintf() that originally was used here was not good enough, but had
to be replaced (in 2009) by broken and hard to understand code I have
no idea.
Found during link-time code generation (!).
Change-Id: I05b33ca0fcb6a47a846ec2ff294243c5639a5b49
Diffstat (limited to 'embedserv')
-rw-r--r-- | embedserv/source/inprocserv/dllentry.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embedserv/source/inprocserv/dllentry.cxx b/embedserv/source/inprocserv/dllentry.cxx index 3622c963f545..e6421285f1eb 100644 --- a/embedserv/source/inprocserv/dllentry.cxx +++ b/embedserv/source/inprocserv/dllentry.cxx @@ -53,7 +53,7 @@ namespace { int nInd = 0; while( nInd < nLen ) { - char nSign = ( nValue / ( 1 << ( ( nLen - nInd ) * 4 ) ) ) % 16; + char nSign = ( nValue / ( 1 << ( ( nLen - nInd - 1 ) * 4 ) ) ) % 16; if ( nSign >= 0 && nSign <= 9 ) pBuf[nInd] = nSign + '0'; else if ( nSign >= 10 && nSign <= 15 ) |