File CVE-2024-57392.patch of Package proftpd.38039

Index: modules/mod_ls.c
===================================================================
--- modules/mod_ls.c.orig	2023-12-20 04:36:38.000000000 +0000
+++ modules/mod_ls.c	2025-03-25 09:02:38.521141101 +0000
@@ -2,7 +2,7 @@
  * ProFTPD - FTP server daemon
  * Copyright (c) 1997, 1998 Public Flood Software
  * Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <macgyver@tos.net>
- * Copyright (c) 2001-2022 The ProFTPD Project
+ * Copyright (c) 2001-2025 The ProFTPD Project
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -360,7 +360,8 @@ static int sendline(int flags, char *fmt
           errno != 0) {
         int xerrno = errno;
 
-        if (session.d != NULL) {
+        if (session.d != NULL &&
+            session.d->outstrm != NULL) {
           xerrno = PR_NETIO_ERRNO(session.d->outstrm);
         }
 
@@ -1101,7 +1102,9 @@ static int outputfiles(cmd_rec *cmd) {
     return res;
   }
 
+  if (tail != NULL) {
   tail->down = NULL;
+  }
   tail = NULL;
   colwidth = (colwidth | 7) + 1;
   if (opt_l || !opt_C) {
openSUSE Build Service is sponsored by