You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
642 B

  1. From 1e8b82388578a622c5caf8fa04c238fdd7808ecc Mon Sep 17 00:00:00 2001
  2. From: Yousong Zhou <yszhou4tech@gmail.com>
  3. Date: Thu, 30 Apr 2015 13:53:40 +0800
  4. Subject: [PATCH 6/7] xl2tpd: fix possible buffer overflow when filling
  5. stropt[].
  6. ---
  7. xl2tpd.c | 3 ++-
  8. 1 file changed, 2 insertions(+), 1 deletion(-)
  9. --- a/xl2tpd.c
  10. +++ b/xl2tpd.c
  11. @@ -490,7 +490,8 @@ int start_pppd (struct call *c, struct p
  12. {
  13. struct ppp_opts *p = opts;
  14. - while (p)
  15. + int maxn_opts = sizeof(stropt) / sizeof(stropt[0]) - 1;
  16. + while (p && pos < maxn_opts)
  17. {
  18. stropt[pos] = strdup (p->option);
  19. pos++;