[bug report] lib/mpi: Extend the MPI library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tianjia Zhang,

The patch a8ea8bdd9df9: "lib/mpi: Extend the MPI library" from Sep
21, 2020 (linux-next), leads to the following Smatch static checker
warning:

	lib/crypto/mpi/mpi-div.c:46 mpi_fdiv_q()
	error: potential null dereference 'tmp'.  (mpi_alloc returns null)

lib/crypto/mpi/mpi-div.c
    43 void mpi_fdiv_q(MPI quot, MPI dividend, MPI divisor)
    44 {
    45         MPI tmp = mpi_alloc(mpi_get_nlimbs(quot));
                   ^^^^^^^^^^^^^^^
Check for failure?

--> 46         mpi_fdiv_qr(quot, tmp, dividend, divisor);
    47         mpi_free(tmp);
    48 }

regards,
dan carpenter



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux