Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/transports/janus_http.c b/transports/janus_http.c
- old mode 100644
- new mode 100755
- index 3d1ef95..a16eb5d
- --- a/transports/janus_http.c
- +++ b/transports/janus_http.c
- @@ -386,7 +386,7 @@ static struct MHD_Daemon *janus_http_create_daemon(gboolean admin, char *path,
- fseek(pem, 0L, SEEK_END);
- size_t size = ftell(pem);
- fseek(pem, 0L, SEEK_SET);
- - cert_pem_bytes = g_malloc0(size);
- + cert_pem_bytes = g_malloc0(size + 1);
- char *index = cert_pem_bytes;
- int read = 0, tot = size;
- while((read = fread(index, sizeof(char), tot, pem)) > 0) {
- @@ -394,13 +394,14 @@ static struct MHD_Daemon *janus_http_create_daemon(gboolean admin, char *path,
- index += read;
- }
- fclose(pem);
- + cert_pem_bytes[size]='\0';
- }
- FILE *key = fopen(server_key, "rb");
- if(key) {
- fseek(key, 0L, SEEK_END);
- size_t size = ftell(key);
- fseek(key, 0L, SEEK_SET);
- - cert_key_bytes = g_malloc0(size);
- + cert_key_bytes = g_malloc0(size + 1);
- char *index = cert_key_bytes;
- int read = 0, tot = size;
- while((read = fread(index, sizeof(char), tot, key)) > 0) {
- @@ -408,6 +409,7 @@ static struct MHD_Daemon *janus_http_create_daemon(gboolean admin, char *path,
- index += read;
- }
- fclose(key);
- + cert_key_bytes[size]='\0';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement