Detected by Coverity in CID1412349
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
search->len = search_len ? ((sizeof(*search) + search_padded) / 8) : 0;
search->pad = 0;
search->pad2 = 0;
- memcpy(search->name, search_domain, search_len);
- memset(&search->name[search_len], 0, search_padded - search_len);
+ if (search_len > 0) {
+ memcpy(search->name, search_domain, search_len);
+ memset(&search->name[search_len], 0, search_padded - search_len);
+ }
size_t routes_cnt = 0;
struct {