On Tue, 1 Aug 2017 09:41:03 -0300 Gustavo Sverzut Barbieri <[email protected]> said:
> ouch, that one as "one star too much" which was hidden by the damn > cast required by nasty posix api. yup. it took me a while to verify/check as indeed due to having to cast it hides and it's a little "odd" with relatively few examples of how to do this for ipv6 around. > I just wonder why coverity didn't found that one. *shrug*. it didn't. also it's a little tested codepath ... as who really has ipv6 set up on their machines at home where they might run make check... :) > On Sat, Jul 29, 2017 at 3:13 AM, Carsten Haitzler <[email protected]> > wrote: > > raster pushed a commit to branch master. > > > > http://git.enlightenment.org/core/efl.git/commit/?id=ff269912207ed2d1480cdee1f5e7b07caaa8876d > > > > commit ff269912207ed2d1480cdee1f5e7b07caaa8876d > > Author: Carsten Haitzler (Rasterman) <[email protected]> > > Date: Sat Jul 29 10:35:39 2017 +0900 > > > > efl net - fix ipv6 getsockname to use the proper struct to do it > > > > struct sockaddr_storage *addr; > > > > AS the actual storage ( a ptr to store the whole data). kind of... > > wrong. it should be: > > > > struct sockaddr_storage addr; > > > > see examples of this kind of usage of getsockname: > > > > > > http://www.masterraghu.com/subjects/np/introduction/unix_network_programming_v1.3/ch04lev1sec10.html > > > > found by PVS studio > > > > @fix > > --- > > src/lib/ecore_con/efl_net_server_tcp.c | 2 +- > > src/lib/ecore_con/efl_net_server_udp.c | 2 +- > > src/lib/ecore_con/efl_net_server_unix.c | 2 +- > > 3 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/src/lib/ecore_con/efl_net_server_tcp.c > > b/src/lib/ecore_con/efl_net_server_tcp.c index c4d1a6259f..f82d57babe 100644 > > --- a/src/lib/ecore_con/efl_net_server_tcp.c > > +++ b/src/lib/ecore_con/efl_net_server_tcp.c > > @@ -167,7 +167,7 @@ _efl_net_server_tcp_efl_net_server_fd_socket_activate > > (Eo *o, Efl_Net_Server_Tcp_ char buf[INET6_ADDRSTRLEN + sizeof("[]:65536")]; > > Eina_Bool listening; > > Eina_Error err; > > - struct sockaddr_storage *addr; > > + struct sockaddr_storage addr; > > socklen_t addrlen; > > SOCKET fd; > > > > diff --git a/src/lib/ecore_con/efl_net_server_udp.c > > b/src/lib/ecore_con/efl_net_server_udp.c index cd68271f95..f45fd615ee 100644 > > --- a/src/lib/ecore_con/efl_net_server_udp.c > > +++ b/src/lib/ecore_con/efl_net_server_udp.c > > @@ -213,7 +213,7 @@ _efl_net_server_udp_efl_net_server_fd_socket_activate > > (Eo *o, Efl_Net_Server_Udp_ { > > char buf[INET6_ADDRSTRLEN + sizeof("[]:65536")]; > > Eina_Error err; > > - struct sockaddr_storage *addr; > > + struct sockaddr_storage addr; > > socklen_t addrlen; > > SOCKET fd; > > > > diff --git a/src/lib/ecore_con/efl_net_server_unix.c > > b/src/lib/ecore_con/efl_net_server_unix.c index 4ec917689d..b1a1d2d158 > > 100644 > > --- a/src/lib/ecore_con/efl_net_server_unix.c > > +++ b/src/lib/ecore_con/efl_net_server_unix.c > > @@ -173,7 +173,7 @@ _efl_net_server_unix_efl_net_server_fd_socket_activate > > (Eo *o, Efl_Net_Server_Uni char buf[INET6_ADDRSTRLEN + sizeof("[]:65536")]; > > Eina_Bool listening; > > Eina_Error err; > > - struct sockaddr_storage *addr; > > + struct sockaddr_storage addr; > > socklen_t addrlen; > > SOCKET fd; > > > > > > -- > > > > > > > > -- > Gustavo Sverzut Barbieri > -------------------------------------- > Mobile: +55 (16) 99354-9890 > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
