diff options
author | Denis Kenzior <denkenz@gmail.com> | 2011-06-29 05:00:56 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-06-29 05:00:56 -0500 |
commit | 2eb4611de8eb1fc874b59b757abfe90b30851d1f (patch) | |
tree | 71fefbfa04692ac8bd64573ae62256a844c1d61b /gatchat/ppp_cp.c | |
parent | e893deac59f35ea30a65f24217d565181b54c400 (diff) | |
download | ofono-2eb4611de8eb1fc874b59b757abfe90b30851d1f.tar.gz |
ppp: Add basic length sanity checks
Diffstat (limited to 'gatchat/ppp_cp.c')
-rw-r--r-- | gatchat/ppp_cp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c index bef83d2c..05f5a76b 100644 --- a/gatchat/ppp_cp.c +++ b/gatchat/ppp_cp.c @@ -945,7 +945,7 @@ void pppcp_send_protocol_reject(struct pppcp_data *data, /* * parse the packet and determine which event this packet caused */ -void pppcp_process_packet(gpointer priv, const guint8 *new_packet) +void pppcp_process_packet(gpointer priv, const guint8 *new_packet, gsize len) { struct pppcp_data *data = priv; const struct pppcp_packet *packet = @@ -953,7 +953,7 @@ void pppcp_process_packet(gpointer priv, const guint8 *new_packet) guint8 event_type; guint data_len = 0; - if (data == NULL) + if (len < sizeof(struct pppcp_packet)) return; /* check flags to see if we support this code */ |