Fix array out of bound exception
PATCH 1/1 Fix array out of bound exception
This patch fixes an array out of bound exception in line 201 of functions.c. We need to reserve one extra character for the appended null character.
Signed-off-by Linus Lüssing <[email protected]>
---
functions.c +2 -2
@@ -161,10 +161,10 @@if (read_opt &USE_READ_BUFF ) { read_ptr = read_buff; - read_len =sizeof (read_buff); + read_len =sizeof (read_buff)-1 ; }else { read_ptr = lbuff; - read_len =sizeof (lbuff); + read_len =sizeof (lbuff)-1 ; } open:
Dear Linus,
thank you for your patch, i have applied it in svn r1496.
Quoted 28 lines · Linus Lüssing
This patch fixes an array out of bound exception in line 201 of
functions.c. We need to reserve one extra character for the appended null character.Signed-off-by Linus Lüssing <[email protected]>---
Index:
batctl/functions.c
===================================================================functions.c +2
-2@@ -161,10 +161,10 @@if (read_opt &USE_READ_BUFF ) { read_ptr = read_buff; - read_len =sizeof (read_buff); + read_len =sizeof (read_buff)-1 ; }else { read_ptr = lbuff; - read_len =sizeof (lbuff); + read_len =sizeof (lbuff)-1 ; } open:_______________________________________________
B.A.T.M.A.N mailing list
[email protected]
https://lists.open-mesh.net/mm/listinfo/b.a.t.m.a.n