ber_bvstrdup - Linux


Overview

ber_bvstrdup allocates a new dynamically sized BER value (octet string) from a buffer allocated by the BER encoder.

Syntax

ber_bvstrdup(ber_int_t fd, ber_slen_t len)

Options/Flags

None

Return Value

A pointer to the octet string created is returned, or NULL on error.

Examples

bv = ber_bvstrdup(fd, (ber_slen_t)strlen(buf));

Common Issues

  • Memory Allocation Failure: If the necessary memory cannot be allocated, ber_bvstrdup will return NULL. Check for this condition and handle it appropriately.

Integration

ber_bvstrdup can be used in conjunction with other BER encoding and decoding functions to dynamically create and manipulate BER values.

Related Commands