You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/01/16 02:04:01 UTC

(nuttx) 02/02: lib_ulimit: fix the variable uninit coverity issue

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit ab572fe1cf74c3269df96127bd8f65af1436a0c1
Author: guoshichao <gu...@xiaomi.com>
AuthorDate: Mon Oct 20 16:04:29 2025 +0800

    lib_ulimit: fix the variable uninit coverity issue
    
    Initialize the rlim_max field in the rlp structure when handling
    UL_SETFSIZE command in ulimit(), resolving an uninitialized variable
    warning from Coverity static analysis.
    
    Signed-off-by: guoshichao <gu...@xiaomi.com>
---
 libs/libc/unistd/lib_ulimit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libs/libc/unistd/lib_ulimit.c b/libs/libc/unistd/lib_ulimit.c
index 776414c6b0e..ddf56b4a4e9 100644
--- a/libs/libc/unistd/lib_ulimit.c
+++ b/libs/libc/unistd/lib_ulimit.c
@@ -62,6 +62,7 @@ long ulimit(int cmd, long newlimit)
       case UL_SETFSIZE:
         {
           struct rlimit rlp;
+          rlp.rlim_max = RLIM_INFINITY;
           rlp.rlim_cur = newlimit * 512UL;
           ret = setrlimit(RLIMIT_FSIZE, &rlp);
         }