]> granicus.if.org Git - php/commitdiff
Ensure there are no line breaks in the error msg
authorAnatol Belski <ab@php.net>
Thu, 1 Feb 2018 14:30:01 +0000 (15:30 +0100)
committerAnatol Belski <ab@php.net>
Thu, 1 Feb 2018 14:30:01 +0000 (15:30 +0100)
ext/standard/dl.c

index 89f8aa0569a710990578f164a628c60e9f0c294a..9cfccd5235dcd2ce69f050bd11ad9c76d6b1c084 100644 (file)
@@ -88,8 +88,10 @@ PHPAPI void *php_load_shlib(char *path, char **errp)
                err = GET_DL_ERROR();
 #ifdef PHP_WIN32
                if (err && (*err)) {
+                       size_t i = strlen(err);
                        (*errp)=estrdup(err);
                        LocalFree(err);
+                       while (i > 0 && isspace((*errp)[i-1])) { (*errp)[i-1] = '\0'; i--; }
                } else {
                        (*errp) = estrdup("<No message>");
                }