"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libcli/nbt/nbtsocket.c" between
samba-4.12.3.tar.gz and samba-4.12.5.tar.gz

About: Samba is the standard Windows interoperability suite of programs for Linux and Unix providing secure, stable and fast file and print services for all clients using the SMB/CIFS protocol. 4.12 series.

nbtsocket.c  (samba-4.12.3):nbtsocket.c  (samba-4.12.5)
skipping to change at line 166 skipping to change at line 166
size_t nread, dsize; size_t nread, dsize;
struct nbt_name_packet *packet; struct nbt_name_packet *packet;
struct nbt_name_request *req; struct nbt_name_request *req;
status = socket_pending(nbtsock->sock, &dsize); status = socket_pending(nbtsock->sock, &dsize);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx); talloc_free(tmp_ctx);
return; return;
} }
/*
* Given a zero length, data_blob_talloc() returns the
* NULL blob {NULL, 0}.
*
* We only want to error return here on a real out of memory condition
* (i.e. dsize != 0, so the UDP packet has data, but the return of the
* allocation failed, so blob.data==NULL).
*
* Given an actual zero length UDP packet having blob.data == NULL
* isn't an out of memory error condition, that's the defined semantics
* of data_blob_talloc() when asked for zero bytes.
*
* We still need to continue to do the zero-length socket_recvfrom()
* read in order to clear the "read pending" condition on the socket.
*/
blob = data_blob_talloc(tmp_ctx, NULL, dsize); blob = data_blob_talloc(tmp_ctx, NULL, dsize);
if (blob.data == NULL) { if (blob.data == NULL && dsize != 0) {
talloc_free(tmp_ctx); talloc_free(tmp_ctx);
return; return;
} }
status = socket_recvfrom(nbtsock->sock, blob.data, blob.length, &nread, status = socket_recvfrom(nbtsock->sock, blob.data, blob.length, &nread,
tmp_ctx, &src); tmp_ctx, &src);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx); talloc_free(tmp_ctx);
return; return;
} }
 End of changes. 2 change blocks. 
1 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)