raster pushed a commit to branch master.

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

commit 2ccfec3dada5d33e45d01745b20763c46f9d7c01
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Apr 19 01:58:44 2020 +0100

    e ckpasswd - handle read errors on stdin
    
    error path - not going to be a problem but in theory... it's there.
    
    fix CID 1425211
---
 src/bin/e_ckpasswd_main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/bin/e_ckpasswd_main.c b/src/bin/e_ckpasswd_main.c
index 8884a68d3..0128d68b8 100644
--- a/src/bin/e_ckpasswd_main.c
+++ b/src/bin/e_ckpasswd_main.c
@@ -296,6 +296,11 @@ main(int argc, char **argv)
         for (;;) // cookie
           {
              rd = read(0, pw + pos, 1);
+             if (rd < 0)
+               {
+                  fprintf(stderr, "Error. Can't read polkit cookie on 
stdin\n");
+                  goto err;
+               }
              if (pw[pos] == ' ')
                {
                   memcpy(polkit_cookie, pw, pos);
@@ -317,6 +322,11 @@ main(int argc, char **argv)
         for (;;) // uid
           {
              rd = read(0, pw + pos, 1);
+             if (rd < 0)
+               {
+                  fprintf(stderr, "Error. Can't read polkit uid on stdin\n");
+                  goto err;
+               }
              if (pw[pos] == ' ')
                {
                   pw[pos] = 0;

-- 


Reply via email to