evaleev / libint

Libint: high-performance library for computing Gaussian integrals in quantum mechanics
Other
226 stars 95 forks source link

Possibility of segmentation fault in compute_2body_fock_deriv (in hartree-fock++.cc) #119

Closed swillow closed 5 years ago

swillow commented 5 years ago

line 1850: auto shset = buf[idx]; To avoid a segmentation fault when shset becomes 'nullptr', it might be better to add the following line

if (shset == nullptr) continue;

after line 1850.

With the same reason, it might be better to add the following lines:

const auto* buf_idx = buf[idx]; if (buf_idx == nullptr) continue;

before line 1071 Eigen::Map buf_mat(buf[idx], n1, n2); in the subroutine compute_1body_ints_deriv.

swillow commented 5 years ago

I did not see the following line. line 1883 if (buf[0] == nullptr)