dbCa: dbCaPutLinkCallback prevent out of bounds write

The internal buffer of the caLink is sized based on the
number of elements of the destination PV.
This commit is contained in:
Michael Davidsaver
2015-02-19 19:18:16 -05:00
parent e822d8d8c4
commit 3501fda48d

View File

@@ -381,6 +381,8 @@ long dbCaPutLinkCallback(struct link *plink,short dbrType,
dbAddr.pfield = pca->pputNative;
/*Following only used for DBF_STRING*/
dbAddr.field_size = MAX_STRING_SIZE;
if(nRequest>pca->nelements)
nRequest = pca->nelements;
status = aConvert(&dbAddr, pbuffer, nRequest, pca->nelements, 0);
}
link_action |= CA_WRITE_NATIVE;