File: src/_fastmath.c
Function: rsaKey_new
Error: dereferencing NULL (key->n) at src/_fastmath.c:706
692 static PyObject *
693 rsaKey_new (PyObject * self, PyObject * args)
694 {
695 	PyLongObject *n = NULL, *e = NULL, *d = NULL, *p = NULL, *q = NULL, 
696                      *u = NULL;
697 	rsaKey *key;
698 
699 	if (!PyArg_ParseTuple(args, "O!O!|O!O!O!O!", &PyLong_Type, &n,
when PyArg_ParseTuple() succeeds
taking False path
700 			      &PyLong_Type, &e, &PyLong_Type, &d, 
701 			      &PyLong_Type, &p, &PyLong_Type, &q,
702                               &PyLong_Type, &u))
703 		return NULL;
704 
705 	key = PyObject_New (rsaKey, &rsaKeyType);
when _PyObject_New() fails
706 	mpz_init (key->n);
dereferencing NULL (key->n) at src/_fastmath.c:706
707 	mpz_init (key->e);
708 	mpz_init (key->d);
709 	mpz_init (key->p);
710 	mpz_init (key->q);
711 	mpz_init (key->u);
712 	longObjToMPZ (key->n, n);
713 	longObjToMPZ (key->e, e);
714 	if (!d)
715 	{
716 		return (PyObject *) key;
717 	}
718 	longObjToMPZ (key->d, d);
719 	if (p && q)
720 	{
721 		longObjToMPZ (key->p, p);
722 		longObjToMPZ (key->q, q);
723 	} else {
724 		if (factorize_N_from_D(key))
725 		{
726 			PyErr_SetString(PyExc_ValueError,
727 			  "Unable to compute factors p and q from exponent d.");
728 			return NULL;
729 		}
730 	}
731 	if (u) {
732 		longObjToMPZ (key->u, u);
733 	} else {
734 		mpz_invert (key->u, key->p, key->q);
735 	}
736 	return (PyObject *) key;
737 }