Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 5 Aug 2012 11:51:00 +0000 (13:51 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 5 Aug 2012 11:51:00 +0000 (13:51 +0200)
citadel/citserver.c
citadel/ecrash.c
citadel/modules/network/serv_network.c
citadel/utils/ctdlmigrate.c

index 42208a7da3d4bee36a9274d6619a316f181010ce..211cefe8850ef4e64aee28c1e3e64aecc04aa28b 100644 (file)
@@ -425,7 +425,7 @@ int is_public_client(void)
                                        }
                                }
                        }
-               fclose(fp);
+               if (fp != NULL) fclose(fp);
                pc_timestamp = time(NULL);
                end_critical_section(S_PUBLIC_CLIENTS);
        }
index b9decd1bfb6fac625e97cec6c7e309186118cebf..ec91a02e4418bc166e9e0289fc5834526b7cf8cc 100644 (file)
@@ -393,6 +393,7 @@ int eCrash_Init(eCrashParameters *params)
 
        DPRINTF(ECRASH_DEBUG_VERY_VERBOSE,"Init Starting params = %p\n", params);
 
+       if (params == NULL) return -1;
        // Allocate our backtrace area
        gbl_backtraceBuffer = malloc(sizeof(void *) * (params->maxStackDepth+5));
 
index 5dbb75f15e8bbec310092fbc7d2d1938f660542b..9c6fb5a7b73f62d88ba397ea049fcf53344d9027 100644 (file)
@@ -259,7 +259,10 @@ int network_sync_to(char *target_node, long len)
        fclose(fp);
        end_critical_section(S_NETCONFIGS);
 
-       if (!found_node) return(-1);
+       if (!found_node) {
+               free(sc.ignet_push_shares);
+               return(-1);
+       }
 
        sc.working_ignetcfg = load_ignetcfg();
        sc.the_netmap = read_network_map();
index 6a501761555760ead7cf8b83e61ab0fa67751802..5a5d0c47498b6a1b79da6f0c985f5e5c83a3eb28 100644 (file)
@@ -55,7 +55,7 @@
 void getz(char *buf) {
        char *ptr;
 
-       ptr = fgets(buf, 32767, stdin);
+       ptr = fgets(buf, SIZ, stdin);
        if (!ptr) {
                buf[0] = 0;
                return;
@@ -81,8 +81,8 @@ int main(int argc, char *argv[])
        char cmd[PATH_MAX];
        char buf[PATH_MAX];
        char socket_path[PATH_MAX];
-       char remote_user[256];
-       char remote_host[256];
+       char remote_user[SIZ];
+       char remote_host[SIZ];
        char remote_sendcommand[PATH_MAX];
        FILE *sourcefp = NULL;
        FILE *targetfp = NULL;