diff options
author | Kenneth G Raeburn <raeburn@mit.edu> | 1988-10-19 18:24:25 +0000 |
---|---|---|
committer | Kenneth G Raeburn <raeburn@mit.edu> | 1988-10-19 18:24:25 +0000 |
commit | 2e81f689c28fdbb65696d0b501ac9ce3b288a0c0 (patch) | |
tree | 91922d974a4f91c639a314d60617ba2b9b699708 /server/uloc.c | |
parent | 01a3b4a3049fb6c431e41f1b43b3b9d736f7ca93 (diff) |
Checking that logout notices are for the sender; verify that
pointer values are NULL before calling free().
Diffstat (limited to 'server/uloc.c')
-rw-r--r-- | server/uloc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/uloc.c b/server/uloc.c index 5ed666c..148f882 100644 --- a/server/uloc.c +++ b/server/uloc.c @@ -177,7 +177,7 @@ ZServerDesc_t *server; server_forward(notice, auth, who); return(ZERR_NONE); } - if (!auth) { + if (!auth || strcmp(notice->z_sender, notice->z_class_inst)) { zdbug((LOG_DEBUG,"unauthentic ulogin")); sense_logout(notice, who); if (server == me_server) @@ -450,7 +450,8 @@ struct in_addr *addr; i++; } - xfree(locations); + if (locations) + xfree(locations); if (!new_num) { zdbug((LOG_DEBUG,"no more locs")); @@ -509,7 +510,8 @@ struct sockaddr_in *sin; i++; } - xfree(locations); + if (locations) + xfree(locations); if (!new_num) { zdbug((LOG_DEBUG,"no more locs")); @@ -688,7 +690,8 @@ struct sockaddr_in *who; locations[i] = oldlocs[i - 1]; i++; } - xfree(oldlocs); + if (oldlocs) + xfree(oldlocs); (void) sigsetmask(omask); #ifdef DEBUG |