Commit 4d417cb0 authored by Max Lv's avatar Max Lv

small fix

parent 93d7bf89
No preview for this file type
......@@ -17,7 +17,7 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libev
LOCAL_CFLAGS += -O2 -DEV_MULTIPLICITY
LOCAL_CFLAGS += -O2 -DNDEBUG -DHAVE_CONFIG_H
LOCAL_SRC_FILES := \
libev/ev.c \
libev/event.c
......
......@@ -114,9 +114,10 @@ static void mergesort(uint8_t array[], int length)
void encrypt(char *buf, int len, EVP_CIPHER_CTX *ctx) {
if (ctx != NULL) {
int outlen;
unsigned char mybuf[BUF_SIZE];
unsigned char *mybuf = malloc(BUF_SIZE);
EVP_CipherUpdate(ctx, mybuf, &outlen, (unsigned char*)buf, len);
memcpy(buf, mybuf, len);
free(mybuf);
} else {
char *end = buf + len;
while (buf < end) {
......@@ -129,9 +130,10 @@ void encrypt(char *buf, int len, EVP_CIPHER_CTX *ctx) {
void decrypt(char *buf, int len, EVP_CIPHER_CTX *ctx) {
if (ctx != NULL) {
int outlen;
unsigned char mybuf[BUF_SIZE];
unsigned char *mybuf = malloc(BUF_SIZE);
EVP_CipherUpdate(ctx, mybuf, &outlen, (unsigned char*) buf, len);
memcpy(buf, mybuf, len);
free(mybuf);
} else {
char *end = buf + len;
while (buf < end) {
......
No preview for this file type
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