Commit 55998d8c authored by 's avatar
Browse files

Added inclusion of mapi_errors.h in anonymize.c

Fixed a potential heap overflow error in mapi_authenticate().


git-svn-id: file:///home/svn/mapi/trunk@563 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 6faafa64
......@@ -14,6 +14,7 @@
#include "mapiipc.h"
#include "anonymization.h"
#include "../stdlib/cooking.h"
#include "mapi_errors.h"
#include "names.h"
extern char *anonnames[];
......
......@@ -2651,10 +2651,10 @@ int mapi_authenticate(int fd, const char *username, const char *password, const
{
case AUTHENTICATE_ACK:
rflow->is_authenticated = 1;
rflow->username = malloc(sizeof(char) * strlen(username));
rflow->vo = malloc(sizeof(char) * strlen(vo));
strncpy(rflow->username, username, MAX_DATA_SIZE);
strncpy(rflow->vo, vo, MAX_DATA_SIZE);
rflow->username = malloc(sizeof(char) * (strlen(username) + 1));
rflow->vo = malloc(sizeof(char) * (strlen(vo) + 1));
snprintf(rflow->username, MAX_DATA_SIZE, "%s", username);
snprintf(rflow->vo, MAX_DATA_SIZE, "%s", vo);
return(0);
break;
case ERROR_ACK:
......@@ -2675,7 +2675,6 @@ int mapi_authenticate(int fd, const char *username, const char *password, const
{
/*
* Now what?
* TODO: Check with the gurus.
*/
return(0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment