Sfoglia il codice sorgente

- from_len properly initialized to the size of from parameter,
reported by Martin Rusnak

Jan Janak 20 anni fa
parent
commit
6e7962a674
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      utils/serunix/serunix.c

+ 1 - 0
utils/serunix/serunix.c

@@ -95,6 +95,7 @@ int main(int argc, char** argv)
 		        goto err;
 		        goto err;
 		}
 		}
 
 
+		from_len = sizeof(from);
 		len = recvfrom(sock, buffer, BUF_SIZE, 0, (struct sockaddr*)&from, &from_len);
 		len = recvfrom(sock, buffer, BUF_SIZE, 0, (struct sockaddr*)&from, &from_len);
 		if (len == -1) {
 		if (len == -1) {
 			fprintf(stderr, "Error in recvfrom: %s\n", strerror(errno));
 			fprintf(stderr, "Error in recvfrom: %s\n", strerror(errno));