raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=f4c49a071f239cdb57a1ada4bf032689ec294d30

commit f4c49a071f239cdb57a1ada4bf032689ec294d30
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Apr 19 01:17:39 2020 +0100

    e auth - also use wrapped memory zeroing in polkit and normal auth
    
    fix CID 1425207
---
 src/bin/e_auth.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/bin/e_auth.c b/src/bin/e_auth.c
index 3fdb2eec7..8b0aa6641 100644
--- a/src/bin/e_auth.c
+++ b/src/bin/e_auth.c
@@ -38,7 +38,7 @@ out:
 E_API int
 e_auth_polkit_begin(char *passwd, const char *cookie, unsigned int uid)
 {
-   char buf[PATH_MAX], *p;
+   char buf[PATH_MAX];
    Ecore_Exe *exe = NULL;
    int ret = 0;
    size_t pwlen, buflen = 0;
@@ -67,14 +67,7 @@ e_auth_polkit_begin(char *passwd, const char *cookie, 
unsigned int uid)
 out:
    if (exe) ecore_exe_free(exe);
 
-   /* security - null out passwd string once we are done with it */
-   for (p = passwd; *p; p++) *p = 0;
-   if (passwd[rand() % pwlen]) fprintf(stderr, "ACK!\n");
-   /* security - null out buf string once we are done with it */
-   if (buflen > 0)
-     {
-        for (p = buf; *p; p++) *p = 0;
-        if (buf[rand() % buflen]) fprintf(stderr, "ACK!\n");
-     }
+   e_util_memclear(passwd, pwlen);
+   e_util_memclear(buf, buflen);
    return ret;
 }

-- 


Reply via email to