fixed access to uninitialized memory in ZAM's "cat" built-in

This commit is contained in:
Vern Paxson 2024-11-07 17:13:22 -08:00
parent a3a0155825
commit 6c2b2819c7
2 changed files with 1 additions and 2 deletions

View file

@ -72,7 +72,7 @@ void FixedCatArg::RenderInto(const ZVal& z, char*& res) {
n = modp_dtoa2(d, res, 6); n = modp_dtoa2(d, res, 6);
res += n; res += n;
if ( util::approx_equal(d, nearbyint(d), 1e-9) && std::isfinite(d) && ! strchr(tmp, 'e') ) { if ( util::approx_equal(d, nearbyint(d), 1e-9) && std::isfinite(d) ) {
// disambiguate from integer // disambiguate from integer
*(res++) = '.'; *(res++) = '.';
*(res++) = '0'; *(res++) = '0';

View file

@ -42,7 +42,6 @@ public:
protected: protected:
TypePtr t; TypePtr t;
char tmp[256];
}; };
class StringCatArg : public CatArg { class StringCatArg : public CatArg {