aboutsummaryrefslogtreecommitdiffstats
path: root/examples/example6.cpp
diff options
context:
space:
mode:
authorJan Engelhardt <[email protected]>2024-05-21 18:48:08 +0000
committerGitHub <[email protected]>2024-05-21 18:48:08 +0000
commita2636bd4ae2c9ed1b4a4a01324300ed1432fd40d (patch)
treef5e431c3440a08b2f95b5d7be4ee07e86a1321c9 /examples/example6.cpp
parentvmime: prevent loss of a space during text::createFromString (#306) (diff)
downloadvmime-a2636bd4ae2c9ed1b4a4a01324300ed1432fd40d.tar.gz
vmime-a2636bd4ae2c9ed1b4a4a01324300ed1432fd40d.zip
asciiPercent computation: another potential multiplication overflow (#307)
* build: resolve a -Wconversion compiler warning wordEncoder.cpp:312:91: warning: conversion from ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} to ‘double’ may change value [-Wconversion] 312 | buffer.length() == 0 ? 1 : static_cast<double>(asciiCount) / buffer.length(); | ~~~~~~~~~~~~~^~ * wordEncoder: replace value 100 for asciiPercent asciiPercent is a ratio, and not counting in units of hundredths anymore. The maximum value therefore should be 1 not 100. * vmime: avoid integer multiply wraparound in text::createFromString The change from commit v0.9.2-194-gb447adbe needs to be applied to one more function that replicates the same code. (If the input string is 42949673 characters long or larger, there will be integer overflow on 32-bit platforms when multiplying by 100. Switch that one computation to floating point.)
Diffstat (limited to 'examples/example6.cpp')
0 files changed, 0 insertions, 0 deletions