michael@stroeder.com wrote:
- /* write out the request to the extended process */
- fprintf( fp, "EXTENDED\n" );
- fprintf( fp, "msgid: %ld\n", (long) op->o_msgid );
- sock_print_conn( fp, op->o_conn, si );
- sock_print_suffixes( fp, op->o_bd );
- fprintf( fp, "oid: %s\n", op->ore_reqoid.bv_val );
- if (op->ore_reqdata) {
fprintf( fp, "valuelen: %lu\n", op->ore_reqdata->bv_len );
fprintf( fp, "value: %s\n", op->ore_reqdata->bv_val );
- }
- fprintf( fp, "\n" );
This isn't safe. The reqdata is binary, not a nul-terminated C string. I suppose you could hex or base64-encode it instead.