Skip to content

Commit

Permalink
Fix Illegal instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
Waujito committed Jan 18, 2025
1 parent 12d6617 commit 2809a5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
#define LOGGING_H
#include "config.h"

#define LOG_ERR KERN_ERR
#define LOG_INFO KERN_INFO
#define LOG_WARN KERN_WARNING

/**
* Defined in args.c
*/
Expand All @@ -39,6 +35,10 @@ extern int ylgh_ndnl;
#define DO_SYSLOG (logging_conf.syslog)

#ifdef KERNEL_SPACE
#define LOG_ERR KERN_ERR
#define LOG_INFO KERN_INFO
#define LOG_WARNING KERN_WARNING

#include <linux/kernel.h>
#include <linux/module.h>
#define printf pr_info
Expand Down Expand Up @@ -110,7 +110,7 @@ extern int ylgh_ndnl;
(log_message(LOG_ERR, msg, ##__VA_ARGS__))

#define lgwarning(msg, ...) \
(log_message(LOG_WARN, msg, ##__VA_ARGS__))
(log_message(LOG_WARNING, msg, ##__VA_ARGS__))


#define lginfo(msg, ...) \
Expand Down
6 changes: 4 additions & 2 deletions src/quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,10 @@ int parse_quic_decrypted(
curptr += fret;
curptr_len -= fret;


if (fr_cr.offset <= crypto_message_len &&
fr_cr.payload_length <= crypto_message_len &&
fr_cr.payload_length <= crypto_message_len
fr_cr.payload_length <= crypto_message_len &&
fr_cr.payload_length + fr_cr.offset <= crypto_message_len
) {

memcpy(crypto_message + fr_cr.offset,
Expand All @@ -418,6 +419,7 @@ int parse_quic_decrypted(
}

out:
lgtrace_addp("crypto message parsed");
*crypto_message_buf = crypto_message;
*crypto_message_buf_len = crypto_message_len;

Expand Down

0 comments on commit 2809a5c

Please sign in to comment.