[Bluez-devel] off-by-one bugfix for sdp_data_alloc

Jeff Wilson
2006-09-02T17:24:20Z

The following patch against bluez-libs-3.4 fixes a problem where the
last character of a null-terminated string is lost. Adding the +1
accounts for and preserves the null terminator.

Regards,
Jeff

--- bluez-libs-3.4/src/sdp.c 2006-08-24 20:16:12.000000000 -0500
+++ bluez-libs-3.4/src/sdp.c.mod 2006-09-02 12:12:51.000000000 -0500
@@ -498,7 +498,7 @@
if (!value)
return NULL;

- length = strlen((char *) value);
+ length = strlen((char *) value) + 1;
break;
default:
length = 0;