зеркало из https://github.com/mozilla/pjs.git
Bug 744816 - Fix leak encrypting passwords for android sync. r=rnewman
This commit is contained in:
Родитель
137fcc0846
Коммит
43b0f04e3f
|
@ -216,10 +216,9 @@ doCrypto(JNIEnv* jenv, const char *path, const char *value, char** result, bool
|
|||
goto done;
|
||||
}
|
||||
|
||||
*result = (char *)malloc(reply.len);
|
||||
(*result)[reply.len] = '\0';
|
||||
*result = (char *)malloc(reply.len+1);
|
||||
strncpy(*result, (char *)reply.data, reply.len);
|
||||
//asprintf(result, "%s", (char *)reply.data);
|
||||
(*result)[reply.len] = '\0';
|
||||
|
||||
LOG("decoded %i letters %s\n", reply.len, *result);
|
||||
free(request.data);
|
||||
|
@ -244,7 +243,7 @@ encode(const unsigned char *data, PRInt32 dataLen, char **_retval)
|
|||
rv = SECFailure;
|
||||
|
||||
if (rv == SECSuccess) {
|
||||
*_retval = (char *)malloc(strlen(encoded));
|
||||
*_retval = (char *)malloc(strlen(encoded)+1);
|
||||
strcpy(*_retval, encoded);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче