On Sun, Apr 03, 2016 at 01:52:16PM +0200, Vincent Bernat wrote: > > l = calloc(1, sizeof(*l)); > > So, I did that too.
Great! > >> 1. can we remove uneeded void* cast? > > > > As much as possible yes! > > OK, done. I did not consider casts of simple types (char*, ...) if they > were not caught by Coccinelle. Too difficult to spot in the code. Ok, don't worry, the amount of cleanup you did is already quite nice! > >> 2. correct dns.c > > > > I don't know the exact bug but I'll trust you :-) > > I still have to do that. I have exhausted the time I can allocate to > this this week-end. Next week-end. OK. > >> 3. correct TLV handling in connection.c > > > > I just checked and the TLV is 32-bit aligned so I guess we don't need > > any change there. > > I was thinking: what about a buggy server sending unaligned TLV? But > since it only happens on arch not allowing unaligned memory access and > you only use proxy with servers you trust, this doesn't matter much. I don't see how it is possible to write unaligned TLV since it must appear on a 4-bytes boundary (or I could be missing something). It's the recipient's responsibility to ensure the buffer's address is properly aligned if it wants to perform direct accesses in it. > >> 4. simplify the occurrence in shctx.c (or not worth it) > > > > Yes, it's a good opportunity for it as well. > > Done in the first patch. > > Hope I didn't break anything. We'll see :-) After a quick glance I didn't notice anything obviously wrong. Anyway if someone purposely used the wrong struct type in a calloc without a surrounding comment explaining why it's normal, it's their fault. Both patches applied, thank you Vincent! Willy

