skypjack / uvw

Header-only, event based, tiny and easy to use libuv wrapper in modern C++ - now available as also shared/static library!
MIT License
1.84k stars 209 forks source link

Uninitialized variable #241

Closed escherstair closed 3 years ago

escherstair commented 3 years ago

I report an error from cppcheck: the variable addr is not initialized here https://github.com/skypjack/uvw/blob/bf61f55dd306b31d7cb90eab8a493c3d405f2402/src/uvw/util.h#L392 and so when the condition if(0 == err) is false, addr is returned unitialized.

I think it should be default initialized as in the next function https://github.com/skypjack/uvw/blob/bf61f55dd306b31d7cb90eab8a493c3d405f2402/src/uvw/util.h#L410