You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am now testing my new linter for checking smart pointer errors, and I have found something in your repo. Some of the classes declare a private auto_ptr field without defining a copy constructor or a copy assignment operator, which will cause the auto_ptr field becomes nullptr when it is copied. And this may cause a null pointer dereference problem when using the field after the object has been copied.
One solution to this issue is to declare both the copy constructor and the copy assignment operator to be deleted to prevent their objects being copied. Just like what is implicitly done when using unique_ptr.
I did not read all your code in your repo, but only reviewed the classes related to my reports. Therefore, I am not very sure whether my reports will really cause a crush. However, I think these reports worth being paid attention to.
I am now testing my new linter for checking smart pointer errors, and I have found something in your repo. Some of the classes declare a private
auto_ptr
field without defining a copy constructor or a copy assignment operator, which will cause theauto_ptr
field becomesnullptr
when it is copied. And this may cause a null pointer dereference problem when using the field after the object has been copied.One solution to this issue is to declare both the copy constructor and the copy assignment operator to be deleted to prevent their objects being copied. Just like what is implicitly done when using
unique_ptr
.I did not read all your code in your repo, but only reviewed the classes related to my reports. Therefore, I am not very sure whether my reports will really cause a crush. However, I think these reports worth being paid attention to.
Here are the reported classes:
cppcms/src/applications_pool.cpp
Line 399 in 270634e
cppcms/src/cache_storage.cpp
Line 122 in 270634e
cppcms/booster/lib/aio/src/io_service.cpp
Line 114 in 270634e
cppcms/booster/lib/locale/src/icu/formatter.cpp
Line 153 in 270634e
cppcms/booster/lib/locale/src/icu/formatter.cpp
Line 153 in 270634e
Hope these reports are useful to you. Please contact me if you have any questions.
Regares.
The text was updated successfully, but these errors were encountered: