Changeset: f3dc0cf0ecda for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f3dc0cf0ecda
Modified Files:
clients/mapilib/mapi.c
monetdb5/modules/mal/mal_mapi.c
tools/merovingian/daemon/client.c
Branch: default
Log Message:
Some minor fixes.
diffs (68 lines):
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -2544,7 +2544,7 @@ mapi_reconnect(Mapi mid)
assert(len < BLOCK);
buf[len] = 0;
- if (len == 0){
+ if (len == 0) {
mapi_setError(mid, "Challenge string is not valid, it is
empty", "mapi_start_talking", MERROR);
return mid->error;
}
@@ -2703,8 +2703,12 @@ mapi_reconnect(Mapi mid)
size_t len;
if (pwh == NULL)
continue;
- len = strlen(pwh) + 11 /* {RIPEMD160} */ + 1;
+ len = strlen(pwh) + strlen(*algs) + 3 /* {}\0
*/;
hash = malloc(len);
+ if (hash == NULL) {
+ close_connection(mid);
+ return mapi_setError(mid, "malloc
failure", "mapi_reconnect", MERROR);
+ }
snprintf(hash, len, "{%s}%s", *algs, pwh);
free(pwh);
break;
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -131,7 +131,7 @@ doChallenge(void *data)
#ifdef DEBUG_SERVER
Client cntxt= mal_clients;
#endif
- char *buf = (char *) GDKmalloc(BLOCK + 1);
+ char *buf = GDKmalloc(BLOCK + 1);
char challenge[13];
stream *fdin = ((struct challengedata *) data)->in;
@@ -145,7 +145,7 @@ doChallenge(void *data)
srand((unsigned int) GDKusec());
#endif
GDKfree(data);
- if (buf == NULL){
+ if (buf == NULL) {
close_stream(fdin);
close_stream(fdout);
return;
@@ -410,7 +410,7 @@ SERVERlistenThread(SOCKET *Sock)
continue;
}
- switch (*buf) {
+ switch (buf[0]) {
case '0':
/* nothing special, nothing to do */
break;
diff --git a/tools/merovingian/daemon/client.c
b/tools/merovingian/daemon/client.c
--- a/tools/merovingian/daemon/client.c
+++ b/tools/merovingian/daemon/client.c
@@ -565,7 +565,7 @@ acceptConnections(int sock, int usock)
continue;
}
- switch (*buf) {
+ switch (buf[0]) {
case '0':
/* nothing special, nothing to do */
break;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list