Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b2a8fb3a7f7935f62a7bbdc851789fb7c2da032
Commit:     4b2a8fb3a7f7935f62a7bbdc851789fb7c2da032
Parent:     7e4a6da7c2a1e0df06b71dc4ddc31910229ba9d9
Author:     Konstantin Sharlaimov <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 23 23:05:54 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sat Jun 23 23:05:54 2007 -0700

    [PPP]: Fix osize too small errors when decoding mppe.
    
    The mppe_decompress() function required a buffer that is 1 byte too
    small when receiving a message of mru size. This fixes buffer
    allocation to prevent this from occurring.
    
    Signed-off-by: Konstantin Sharlaimov <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/ppp_generic.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 5411687..3ef0092 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1708,7 +1708,18 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff 
*skb)
                goto err;
 
        if (proto == PPP_COMP) {
-               ns = dev_alloc_skb(ppp->mru + PPP_HDRLEN);
+               int obuff_size;
+
+               switch(ppp->rcomp->compress_proto) {
+               case CI_MPPE:
+                       obuff_size = ppp->mru + PPP_HDRLEN + 1;
+                       break;
+               default:
+                       obuff_size = ppp->mru + PPP_HDRLEN;
+                       break;
+               }
+
+               ns = dev_alloc_skb(obuff_size);
                if (ns == 0) {
                        printk(KERN_ERR "ppp_decompress_frame: no memory\n");
                        goto err;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to