LDNS_STATUS_ERR,
LDNS_STATUS_INT_EXP,
LDNS_STATUS_INVALID_IP4,
- LDNS_STATUS_INVALID_IP6
+ LDNS_STATUS_INVALID_IP6,
+ LDNS_STATUS_INVALID_STR
};
typedef enum ldns_enum_status ldns_status;
syn keyword ldnsMacro LDNS_STATUS_ERR
syn keyword ldnsMacro LDNS_STATUS_INVALID_IP4
syn keyword ldnsMacro LDNS_STATUS_INVALID_IP6
+syn keyword ldnsMacro LDNS_STATUS_INVALID_STR
" ldns/resolver.h
syn keyword ldnsType ldns_resolver
}
/**
- * convert .... into wireformat
+ * convert a string into wireformat (think txt record)
* \param[in] rd the rdf where to put the data
- * \param[in] str the string to be converted
+ * \param[in] str the string to be converted (NULL terminated)
* \return ldns_status
*/
ldns_status
ldns_str2rdf_str(ldns_rdf **rd, const uint8_t* str)
{
+ if (strlen(str) > 255) {
+ return LDNS_STATUS_INVALID_STR;
+ }
+ ldns_rdf_new(strlen(str), LDNS_RDF_TYPE_STR, str);
return LDNS_STATUS_OK;
}