[PATCH] possible stack overflow in lib/libatm

Sepherosa Ziehau sepherosa at gmail.com
Mon May 2 18:28:55 PDT 2005


OK, patch recreated (strip off guarding against NULL pointer accessing).
Please review it.

Best Regards,
sephe

On 5/2/05, Joerg Sonnenberger <joerg at xxxxxxxxxxxxxxxxx> wrote:
> On Mon, May 02, 2005 at 05:43:14PM +0800, Sepherosa Ziehau wrote:
> > lib/libatm
> > 1) guard against possible stack overflow
> > 2) guard against possible NULL pointer accessing
> 
> The first is ok. I'm not sure I like the others. It is common to
> let the caller guard for that, because it has to do that anyway.
> 
> Joerg
> 


-- 
Live Free or Die
Index: atm_addr.c
===================================================================
RCS file: /opt/df_cvs/src/lib/libatm/atm_addr.c,v
retrieving revision 1.3
diff -u -r1.3 atm_addr.c
--- atm_addr.c	23 Sep 2004 21:39:08 -0000	1.3
+++ atm_addr.c	2 May 2005 09:43:44 -0000
@@ -177,6 +177,8 @@
 			 */
 			val = val << 4;
 			val += c_value;
+			if (out_len >= len)
+				return 0;
 			out[out_len] = (u_char) val;
 			out_len++;
 			break;




More information about the Submit mailing list