diff options
| author | Paul Wilkinson <paul.wilkinson@cantab.net> | 2014-05-10 15:23:21 +0100 |
|---|---|---|
| committer | Ned T. Crigler <crigler@users.sourceforge.net> | 2014-08-04 12:46:38 -0700 |
| commit | fc78d94e7f1b810b56d25fd25ae7ef6b076d6ab8 (patch) | |
| tree | 66476e80b6c287d3c1405fad60688400fd461f3e | |
| parent | c7b68ae3fa3f8b367b0b8201e5ab3d0323363ee4 (diff) | |
Silence valgrind memcheck error by memset()-ing pkt to 0
valgrind reports:
Syscall param write(buf) points to uninitialised byte(s)
In this case, it is a false positive, but adding this single memset at
attach start-up means the program is now clean when run with "valgrind
--trace-children=yes dtach -c ...", which can make future debugging
easier.
| -rw-r--r-- | attach.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -190,6 +190,7 @@ attach_main(int noerror) write(1, "\33[H\33[J", 6); /* Tell the master that we want to attach. */ + memset(&pkt, 0, sizeof(struct packet)); pkt.type = MSG_ATTACH; write(s, &pkt, sizeof(struct packet)); |
