Changeset 590 for trunk/src/sh_suidchk.c


Ignore:
Timestamp:
Oct 27, 2025, 6:57:03 PM (17 hours ago)
Author:
katerina
Message:

Fix for ticket #478 (cppcheck warnings).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_suidchk.c

    r583 r590  
    10191019  SL_ENTER(_("sh_suidchk_check_internal"));
    10201020
     1021  if (iname == NULL)
     1022    {
     1023      TPT((0, FIL__, __LINE__ , _("msg=<directory name is NULL>\n")));
     1024      SL_RETURN( (-1), _("sh_suidchk_check_internal"));
     1025    }
     1026
     1027  if (sig_urgent > 0) {
     1028    SL_RETURN( (0), _("sh_suidchk_check_internal"));
     1029  }
     1030
    10211031  /* Take the address to keep gcc from putting it into a register.
    10221032   * Avoids the 'clobbered by longjmp' warning.
     
    10241034  sh_dummy_idirlist = (void*) &dirlist;
    10251035  sh_dummy_itmp     = (void*) &tmp;
    1026 
    1027   if (iname == NULL)
    1028     {
    1029       TPT((0, FIL__, __LINE__ , _("msg=<directory name is NULL>\n")));
    1030       SL_RETURN( (-1), _("sh_suidchk_check_internal"));
    1031     }
    1032 
    1033   if (sig_urgent > 0) {
    1034     SL_RETURN( (0), _("sh_suidchk_check_internal"));
    1035   }
    10361036
    10371037  thisDir = opendir (iname);
     
    10471047      SH_MUTEX_UNLOCK(mutex_thread_nolog);
    10481048      SH_FREE(tmp);
     1049      sh_dummy_idirlist = NULL;
     1050      sh_dummy_itmp     = NULL;
    10491051      SL_RETURN( (-1), _("sh_suidchk_check_internal"));
    10501052    }
     
    14121414  kill_sh_dirlist (dirlist_orig);
    14131415
     1416  sh_dummy_idirlist = NULL;
     1417  sh_dummy_itmp     = NULL;
     1418
    14141419  SL_RETURN( (0), _("sh_suidchk_check_internal"));
    14151420}
     
    21932198   Return "unknown" if its filesystem type is unknown.  */
    21942199
    2195 static char *
    2196 filesystem_type (char * path, char * relpath, struct stat * statp)
     2200static char * filesystem_type (char * path, char * relpath, struct stat * statp)
    21972201{
    21982202  static char *current_fstype = NULL;
     
    22182222void * sh_dummy_2229_type;
    22192223
    2220 static char *
    2221 filesystem_type_uncached (path, relpath, statp)
    2222      char *path;
    2223      char *relpath;
    2224      struct stat *statp;
     2224static char * filesystem_type_uncached (char * path, char * relpath, struct stat * statp)
    22252225{
    22262226  char * type = NULL;
     
    22342234  struct mntent *mnt;
    22352235
     2236  if (path == NULL || relpath == NULL)
     2237    return NULL;
     2238
    22362239  /* Take the address to keep gcc from putting it into a register.
    22372240   * Avoids the 'clobbered by longjmp' warning.
    22382241   */
    22392242  sh_dummy_2229_type = (void *) &type;
    2240 
    2241   if (path == NULL || relpath == NULL)
    2242     return NULL;
    22432243
    22442244  mfp = setmntent (table, "r");
     
    22502250                       _("filesystem_type_uncached") );
    22512251      SH_MUTEX_UNLOCK(mutex_thread_nolog);
     2252      sh_dummy_2229_type = NULL;
    22522253      return NULL;
    22532254    }
     
    23782379                           _("filesystem_type_uncached") );
    23792380          SH_MUTEX_UNLOCK(mutex_thread_nolog);
     2381          sh_dummy_2229_type = NULL;
    23802382          return NULL;
    23812383        }
     
    24062408                           _("filesystem_type_uncached") );
    24072409          SH_MUTEX_UNLOCK(mutex_thread_nolog);
     2410          sh_dummy_2229_type = NULL;
    24082411          return NULL;
    24092412        }
     
    24532456                           _("filesystem_type_uncached") );
    24542457          SH_MUTEX_UNLOCK(mutex_thread_nolog);
     2458          sh_dummy_2229_type = NULL;
    24552459          return NULL;
    24562460        }
     
    24922496  fstype_known = (int)(type != NULL);
    24932497
     2498  sh_dummy_2229_type = NULL;
    24942499  return sh_util_strdup (type ? type : "unknown");
    24952500}
     
    25002505   part of CP. */
    25012506
    2502 static int
    2503 xatoi (cp)
    2504      const char *cp;
     2507static int xatoi (const char * cp)
    25052508{
    25062509  int val;
Note: See TracChangeset for help on using the changeset viewer.