Make sure we don't overflow the dialedDigits array.

svn path=/trunk/; revision=15702
This commit is contained in:
Guy Harris 2005-09-06 17:44:20 +00:00
parent 33d72d3b9d
commit 75dc6f1a66
2 changed files with 9 additions and 3 deletions

View File

@ -213,10 +213,13 @@ CallIdentifier/guid guid
if (h225_pi->is_destinationInfo == TRUE) {
if (value_tvb) {
len = tvb_length(value_tvb);
/* XXX - should this be allocated as an ephemeral string? */
if (len > sizeof h225_pi->dialedDigits - 1)
len = sizeof h225_pi->dialedDigits - 1;
tvb_memcpy(value_tvb, (guint8*)h225_pi->dialedDigits, 0, len);
}
h225_pi->dialedDigits[len] = '\0';
h225_pi->is_destinationInfo = FALSE;
h225_pi->is_destinationInfo = FALSE;
}
#.END
#----------------------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Ethereal dissector compiler */
/* .\packet-h225.c */
/* ./packet-h225.c */
/* ../../tools/asn2eth.py -X -e -p h225 -c h225.cnf -s packet-h225-template h225.asn */
/* Input file: packet-h225-template.c */
@ -2246,10 +2246,13 @@ dissect_h225_DialedDigits(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, pro
if (h225_pi->is_destinationInfo == TRUE) {
if (value_tvb) {
len = tvb_length(value_tvb);
/* XXX - should this be allocated as an ephemeral string? */
if (len > sizeof h225_pi->dialedDigits - 1)
len = sizeof h225_pi->dialedDigits - 1;
tvb_memcpy(value_tvb, (guint8*)h225_pi->dialedDigits, 0, len);
}
h225_pi->dialedDigits[len] = '\0';
h225_pi->is_destinationInfo = FALSE;
h225_pi->is_destinationInfo = FALSE;
}
return offset;