# HG changeset patch # User rtogni # Date 1171216855 0 # Node ID 6b84fac921eb2ddd342e5cf8eecb265bce0e3999 # Parent b9fa8b0ddab97aec700ad3d1553d547904dbdd50 More strncat() misuses. Reported by Sascha Sommer diff -r b9fa8b0ddab9 -r 6b84fac921eb stream/freesdp/parser.c --- a/stream/freesdp/parser.c Sun Feb 11 18:00:06 2007 +0000 +++ b/stream/freesdp/parser.c Sun Feb 11 18:00:55 2007 +0000 @@ -479,9 +479,9 @@ { /* ignore unknown attributes, but provide access to them */ *longfsdp_buf = '\0'; - strncat (longfsdp_buf, fsdp_buf[0], MAXLONGFIELDLEN); - strncat (longfsdp_buf, ":", MAXLONGFIELDLEN); - strncat (longfsdp_buf, fsdp_buf[1], MAXLONGFIELDLEN); + strncat (longfsdp_buf, fsdp_buf[0], MAXLONGFIELDLEN-1); + strncat (longfsdp_buf, ":", MAXLONGFIELDLEN-strlen(longfsdp_buf)-1); + strncat (longfsdp_buf, fsdp_buf[1], MAXLONGFIELDLEN-strlen(longfsdp_buf)-1); if (NULL == dsc->unidentified_attributes) { dsc->unidentified_attributes_count = 0; @@ -515,7 +515,7 @@ { /* ignore unknown attributes, but provide access to them */ *longfsdp_buf = '\0'; - strncat (longfsdp_buf, fsdp_buf[0], MAXLONGFIELDLEN); + strncat (longfsdp_buf, fsdp_buf[0], MAXLONGFIELDLEN-1); if (NULL == dsc->unidentified_attributes) { dsc->unidentified_attributes_count = 0; @@ -868,7 +868,7 @@ { /* ignore unknown attributes, but provide access to them */ *longfsdp_buf = '\0'; - strncat (longfsdp_buf, fsdp_buf[0], MAXLONGFIELDLEN); + strncat (longfsdp_buf, fsdp_buf[0], MAXLONGFIELDLEN-1); if (NULL == media->unidentified_attributes) { media->unidentified_attributes_count = 0;