- Timestamp:
- Oct 31, 2016, 8:31:24 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dnmalloc.c
r481 r516 5296 5296 { 5297 5297 mstate av = get_malloc_state(); 5298 st ruct mallinfo mi;5298 static struct mallinfo mi; 5299 5299 unsigned int i; 5300 5300 mbinptr b; … … 5312 5312 check_malloc_state(); 5313 5313 5314 if (!av || av->top == 0) { 5315 return mi; 5316 } 5317 5314 5318 /* Account for top */ 5315 5319 avail = chunksize(av->top); … … 5362 5366 (CHUNK_SIZE_T)(HASHTABLESIZE / (1024*1024))); 5363 5367 fprintf(stderr, "max system bytes = %10lu\n", 5364 5368 (CHUNK_SIZE_T)(mi.usmblks)); 5365 5369 fprintf(stderr, "system bytes = %10lu (%10lu sbrked, %10lu mmaped)\n", 5366 5367 5368 5370 (CHUNK_SIZE_T)(mi.arena + mi.hblkhd), 5371 (CHUNK_SIZE_T)(mi.arena), 5372 (CHUNK_SIZE_T)(mi.hblkhd)); 5369 5373 fprintf(stderr, "in use bytes = %10lu\n", 5370 (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd)); 5371 5374 (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd)); 5372 5375 } 5373 5376 -
trunk/src/sh_audit.c
r514 r516 415 415 /* Check whether it is already covered by a higher directory 416 416 */ 417 static int test_exchange (struct aud_list * this, c har * file)417 static int test_exchange (struct aud_list * this, const char * file) 418 418 { 419 419 size_t len0 = sl_strlen(this->file); … … 421 421 int ret = -1; 422 422 423 if (!file || !this || !this->file) 424 return 0; 425 423 426 if (len0 == len1) 424 427 { -
trunk/src/sh_err_log.c
r481 r516 1284 1284 status = sl_forward(fd); 1285 1285 if (!SL_ISERROR(status)) 1286 s tatus = sl_write (fd, report, strlen(report));1286 sl_write (fd, report, strlen(report)); 1287 1287 (void) sl_sync(fd); 1288 1288 -
trunk/src/sh_files.c
r505 r516 622 622 size_t l_name; 623 623 char * candidate = NULL; 624 size_t l_candidate = 0;624 volatile size_t l_candidate = 0; 625 625 626 626 if (NULL == tree) … … 2046 2046 #endif 2047 2047 2048 staticvoid * sh_dummy_dirlist;2049 staticvoid * sh_dummy_tmpcat;2048 void * sh_dummy_dirlist; 2049 void * sh_dummy_tmpcat; 2050 2050 2051 2051 /* -- Check a single directory and its content. Does not -
trunk/src/sh_hash.c
r514 r516 1255 1255 sh_file_t * sh_hash_push_int (file_type * buf, char * fileHash) 1256 1256 { 1257 sh_file_t * fp ;1257 sh_file_t * fp = NULL; 1258 1258 sh_filestore_t p; 1259 1259 … … 1266 1266 SL_ENTER(_("sh_hash_push_int")); 1267 1267 1268 if (!buf) 1269 SL_RETURN(NULL, _("sh_hash_push_int")); 1270 1268 1271 fp = SH_ALLOC(sizeof(sh_file_t)); 1269 1272 … … 1807 1810 int retval = 0; 1808 1811 1812 if (!theFile) 1813 return retval; 1814 1809 1815 if (S_FALSE == sh_ignore_chk_new(theFile->fullpath)) 1810 1816 { … … 1899 1905 SL_ENTER(_("sh_hash_compdata")); 1900 1906 1901 if (IsInit != 1) sh_hash_init(); 1907 if (!theFile) 1908 SL_RETURN(0, _("sh_hash_compdata")); 1909 1910 if (IsInit != 1) sh_hash_init(); 1902 1911 1903 1912 if (severity_override < 0) -
trunk/src/sh_log_repeat.c
r272 r516 59 59 #define SH_CLEANUP 256 60 60 61 void * sh_dummy_g_array = NULL; 62 61 63 static struct gestalt * add_entry (unsigned char * flags, UINT16 * sum, 62 64 time_t ltime) … … 64 66 struct gestalt * array = NULL; 65 67 68 sh_dummy_g_array = (void*) &array; 69 66 70 start: 67 71 if (urec < nrec) … … 165 169 struct gestalt * array = arec; 166 170 171 sh_dummy_g_array = (void*) &array; 172 167 173 memcpy(flint, flags, SH_NFIELDS); 168 174 -
trunk/src/sh_mem.c
r489 r516 318 318 } 319 319 320 staticvoid ** sh_mem_dummy_a;321 staticmemlist_t ** sh_mem_merr_3;320 void ** sh_mem_dummy_a; 321 memlist_t ** sh_mem_merr_3; 322 322 323 323 void sh_mem_free (void * aa, char * file, int line) -
trunk/src/sh_portcheck.c
r511 r516 1808 1808 static int iface_comp (const void *a, const void *b) 1809 1809 { 1810 const struct portchk_interfaces * aa = ( struct portchk_interfaces *) a;1811 const struct portchk_interfaces * bb = ( struct portchk_interfaces *) b;1810 const struct portchk_interfaces * aa = (const struct portchk_interfaces *) a; 1811 const struct portchk_interfaces * bb = (const struct portchk_interfaces *) b; 1812 1812 return (aa->type - bb->type); 1813 1813 } -
trunk/src/sh_string.c
r484 r516 644 644 len = (size_t) tlen; 645 645 646 if (tlen > 0 && r->siz > (r->len + len)) 646 if (tlen > 0 && r->siz > (r->len + len) && 647 &(s->str[ovector[last]]) ) 647 648 { 648 649 memcpy(p, &(s->str[ovector[last]]), (size_t)len); … … 675 676 { 676 677 len = (size_t)tlen; 677 if (r->siz >= (r->len + len)) { 678 if (r->siz >= (r->len + len) && 679 &(s->str[ovector[2*i -1]]) ) { 678 680 memcpy(p, &(s->str[ovector[2*i -1]]), (size_t)len); 679 681 p += (len - 1); -
trunk/src/sh_suidchk.c
r483 r516 997 997 * by longjmp' warning. And no, 'volatile' proved insufficient. 998 998 */ 999 static void * sh_dummy_dirlist = NULL;1000 static void * sh_dummy_itmp= NULL;999 void * sh_dummy_idirlist = NULL; 1000 void * sh_dummy_itmp = NULL; 1001 1001 1002 1002 … … 1028 1028 * Avoids the 'clobbered by longjmp' warning. 1029 1029 */ 1030 sh_dummy_ dirlist = (void*) &dirlist;1031 sh_dummy_itmp = (void*) &tmp;1030 sh_dummy_idirlist = (void*) &dirlist; 1031 sh_dummy_itmp = (void*) &tmp; 1032 1032 1033 1033 if (iname == NULL) … … 1146 1146 ShSuidchkFps) , 0); 1147 1147 } 1148 1148 1149 1149 status = (int) retry_lstat(FIL__, __LINE__, tmpcat, &buf); 1150 1150 … … 1186 1186 */ 1187 1187 fs = filesystem_type (tmpcat, tmpcat, &buf); 1188 1188 1189 if (fs != NULL 1189 1190 #ifndef SH_SUIDTESTDIR … … 1520 1521 status = sh_suidchk_check_internal (SH_SUIDTESTDIR); 1521 1522 #else 1523 #error 1522 1524 status = sh_suidchk_check_internal ("/"); 1523 1525 #endif … … 2211 2213 current_dev = statp->st_dev; 2212 2214 current_fstype = filesystem_type_uncached (path, relpath, statp); 2215 2213 2216 return current_fstype; 2214 2217 } … … 2232 2235 #endif 2233 2236 2234 #ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix .*/2237 #ifdef FSTYPE_MNTENT /* 4.3BSD, SunOS, HP-UX, Dynix, Irix,Linux */ 2235 2238 char *table = MOUNTED; 2236 2239 FILE *mfp; … … 2294 2297 volatile int elevel = SH_ERR_ERR; 2295 2298 size_t tlen = strlen(mnt->mnt_dir); 2296 2299 2297 2300 if (tlen >= 6 && 0 == strcmp(&((mnt->mnt_dir)[tlen-6]), _("/.gvfs"))) 2298 2301 elevel = SH_ERR_NOTICE; 2299 2302 else if (tlen >= 5 && 0 == strcmp(&((mnt->mnt_dir)[tlen-5]), _("/gvfs"))) 2300 2303 elevel = SH_ERR_NOTICE; 2301 2304 else if (0 == strcmp (mnt->mnt_type, _("tracefs"))) 2305 elevel = SH_ERR_NOTICE; 2306 2302 2307 sl_snprintf(errmsg, sizeof(errmsg), _("stat(%s) failed"), 2303 2308 mnt->mnt_dir); … … 2307 2312 _("filesystem_type_uncached") ); 2308 2313 SH_MUTEX_UNLOCK(mutex_thread_nolog); 2309 return NULL;2314 continue; 2310 2315 } 2311 2316 dev = disk_stats.st_dev; -
trunk/src/sh_unix.c
r513 r516 3792 3792 3793 3793 static void * sh_dummy_filename; 3794 staticvoid * sh_dummy_tmp;3795 staticvoid * sh_dummy_tmp2;3794 void * sh_dummy_tmp; 3795 void * sh_dummy_tmp2; 3796 3796 3797 3797 int sh_unix_getinfo (int level, const char * filename, file_type * theFile,
Note:
See TracChangeset
for help on using the changeset viewer.