tFail when menu data is incomplete - phroxy - Gopher to HTTP proxy
 (HTM) git clone git://git.z3bra.org/phroxy.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit da42dfe53a9cee016cfcb55eb33db0247a7a5563
 (DIR) parent a833b87179ac706192d6f767d94d23c0e3507c67
 (HTM) Author: Willy Goiffon <dev@z3bra.org>
       Date:   Mon, 14 Sep 2020 16:45:31 +0200
       
       Fail when menu data is incomplete
       
       Diffstat:
         M phroxy.c                            |       4 ++++
       
       1 file changed, 4 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/phroxy.c b/phroxy.c
       t@@ -383,6 +383,10 @@ phroxy(char *url)
                if (!data)
                        return 1;
        
       +        /* fail on incomplete menu output */
       +        if (item == '1 && strncmp(data[len - 5], "\r\n.\r\n"))
       +                return 1;
       +
                serveitem(item, data, len);
        
                return 0;