[systemd-commits] src/shared

Daniel Mack zonque at kemper.freedesktop.org
Tue Aug 19 13:10:51 PDT 2014


 src/shared/memfd.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit ea47ff669723739e62a9bce6599b0346e464c08f
Author: Daniel Mack <zonque at gmail.com>
Date:   Tue Aug 19 22:08:54 2014 +0200

    memfd: skip utf-8 escaping if we use a name that was passed in
    
    If a name was passed in as function argument, trust it, and don't do utf-8
    encoding for them. Callers are obliged to check the names themselves, and
    escape them in case they use anything they got from the outside world.

diff --git a/src/shared/memfd.c b/src/shared/memfd.c
index e335c0c..c21642f 100644
--- a/src/shared/memfd.c
+++ b/src/shared/memfd.c
@@ -54,13 +54,7 @@ int memfd_new(const char *name) {
                 if (isempty(pr))
                         name = "sd";
                 else {
-                        _cleanup_free_ char *e = NULL;
-
-                        e = utf8_escape_invalid(pr);
-                        if (!e)
-                                return -ENOMEM;
-
-                        g = strappend("sd-", e);
+                        g = strappend("sd-", pr);
                         if (!g)
                                 return -ENOMEM;
 



More information about the systemd-commits mailing list