commit d0e9ea471e2ce27cbb04b78cacaad81055468df1
Author: Oswald Buddenhagen <[email protected]>
Date:   Thu Sep 25 13:53:49 2025 +0200

    fix crash in mkdir_p() with invalid path
    
    if the user specified Inbox as a non-existing path in a directory they
    can't write to, we'd hit the root and crash due to a null pointer deref.
    
    REFMAIL: CAEJTn2UzcnD_p=ogAcaci8Pecb8pDk=2qi6p0jx1pua-hkv...@mail.gmail.com

 src/util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util.c b/src/util.c
index 121ab0a..c110188 100644
--- a/src/util.c
+++ b/src/util.c
@@ -796,6 +796,8 @@ mkdir_p( char *path, int len )
        if (!mkdir( path, 0700 ) || errno == EEXIST)
                return 0;
        char *p = memrchr( path, '/', (size_t)len );
+       if (!p)
+               return -1;  // mkdir() already set errno
        *p = 0;
        if (mkdir_p( path, (int)(p - path) )) {
                *p = '/';


_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to