[pulseaudio-commits] src/pulsecore

Tanu Kaskinen tanuk at kemper.freedesktop.org
Fri Apr 10 07:00:22 PDT 2015


 src/pulsecore/core-util.c |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit ef864eeab0cc662f41a768fcb658a15e0e7f6648
Author: Tanu Kaskinen <tanu.kaskinen at linux.intel.com>
Date:   Fri Apr 10 12:44:02 2015 +0300

    core-util: Filter out not-a-numbers in pa_atod()
    
    We don't and probably never will have any pa_atod() callers that would
    require "NaN" to be accepted, so let's filter those out in pa_atod(),
    instead of requiring the callers to handle not-a-numbers appropriately
    (which they generally forget to do).

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 1dad507..4526306 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -23,6 +23,7 @@
 #include <config.h>
 #endif
 
+#include <math.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <signal.h>
@@ -2448,6 +2449,11 @@ int pa_atod(const char *s, double *ret_d) {
         return -1;
     }
 
+    if (isnan(f)) {
+        errno = EINVAL;
+        return -1;
+    }
+
     *ret_d = f;
 
     return 0;



More information about the pulseaudio-commits mailing list