[Python-checkins] CVS: python/dist/src/Modules structmodule.c,2.47,2.48

Tim Peters tim_one@users.sourceforge.net
2001年6月12日 18:26:37 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv17987/python/dist/src/Modules
Modified Files:
	structmodule.c 
Log Message:
The new {b,l}p_{u,}longlong() didn't check get_pylong()'s return for NULL.
Repaired that, and added appropriate tests for it to test_struct.py.
Index: structmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v
retrieving revision 2.47
retrieving revision 2.48
diff -C2 -r2.47 -r2.48
*** structmodule.c	2001年06月12日 01:22:21	2.47
--- structmodule.c	2001年06月13日 01:26:35	2.48
***************
*** 875,878 ****
--- 875,880 ----
 	int res;
 	v = get_pylong(v);
+ 	if (v == NULL)
+ 		return -1;
 	res = _PyLong_AsByteArray((PyLongObject *)v,
 			 	 (unsigned char *)p,
***************
*** 889,892 ****
--- 891,896 ----
 	int res;
 	v = get_pylong(v);
+ 	if (v == NULL)
+ 		return -1;
 	res = _PyLong_AsByteArray((PyLongObject *)v,
 			 	 (unsigned char *)p,
***************
*** 1037,1040 ****
--- 1041,1046 ----
 	int res;
 	v = get_pylong(v);
+ 	if (v == NULL)
+ 		return -1;
 	res = _PyLong_AsByteArray((PyLongObject*)v,
 			 	 (unsigned char *)p,
***************
*** 1051,1054 ****
--- 1057,1062 ----
 	int res;
 	v = get_pylong(v);
+ 	if (v == NULL)
+ 		return -1;
 	res = _PyLong_AsByteArray((PyLongObject*)v,
 			 	 (unsigned char *)p,

AltStyle によって変換されたページ (->オリジナル) /