summaryrefslogtreecommitdiffstats
path: root/ssl/quic
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2024-03-30 12:52:50 +0100
committerTomas Mraz <tomas@openssl.org>2024-04-04 18:16:05 +0200
commita19553cd872047289d6fc730a864bf9d984283ce (patch)
tree26d4da2acaeed0bcdf27042da853b47f7ffbbe72 /ssl/quic
parent089271601a1d085f33ef7b7d8c3b6879045be370 (diff)
Diverse small VMS build fixups
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24008) (cherry picked from commit 1a4b029af51ba6128a37959796381ca5b8b7ac00)
Diffstat (limited to 'ssl/quic')
-rw-r--r--ssl/quic/json_enc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/ssl/quic/json_enc.c b/ssl/quic/json_enc.c
index 650247f869..990c67dc5f 100644
--- a/ssl/quic/json_enc.c
+++ b/ssl/quic/json_enc.c
@@ -9,6 +9,7 @@
#include "internal/json_enc.h"
#include "internal/nelem.h"
+#include "internal/numbers.h"
#include <string.h>
#include <math.h>
@@ -602,10 +603,19 @@ void ossl_json_f64(OSSL_JSON_ENC *json, double value)
if (!json_pre_item(json))
return;
- if (isnan(value) || isinf(value)) {
- json_raise_error(json);
- return;
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ {
+ int checks = isnan(value);
+# if !defined(OPENSSL_SYS_VMS)
+ checks |= isinf(value);
+# endif
+
+ if (checks) {
+ json_raise_error(json);
+ return;
+ }
}
+#endif
BIO_snprintf(buf, sizeof(buf), "%1.17g", value);
json_write_str(json, buf);