int sargc = 0;
char *p, *modname;
- assert(argc > 0);
+ assert(argc > 0 && *argv != NULL);
if (**argv == '/') {
rprintf(FERROR,
if ((p = strstr(module_dir, "/./")) != NULL) {
*p = '\0';
p += 2;
- } else if ((p = strdup("/")) == NULL)
+ } else if ((p = strdup("/")) == NULL) /* MEMORY LEAK */
out_of_memory("rsync_module");
}
munge_symlinks = !use_chroot || module_dirlen;
if (munge_symlinks) {
STRUCT_STAT st;
- if (stat(SYMLINK_PREFIX, &st) == 0 && S_ISDIR(st.st_mode)) {
+ if (do_stat(SYMLINK_PREFIX, &st) == 0 && S_ISDIR(st.st_mode)) {
rprintf(FLOG, "Symlink munging is unsupported when a %s directory exists.\n",
SYMLINK_PREFIX);
io_printf(f_out, "@ERROR: daemon security issue -- contact admin\n", name);