library/src/exploitation/WebExploitation/BP-WebExploitation.cc
// Generates a new anchor structure for performing injections
// on anchors anchors given a replacement variable position, and
// a replacement string.  This function is a primary component of
// the injection facilities of BP.  The returned structure is a
// DUPLICATE, and is not the same as the structure brought in.
// Additionally, its list size is one anchor element long.
Generates a new anchor structure for performing injections
on anchors anchors given a replacement variable position, and
a replacement string.  This function is a primary component of
the injection facilities of BP.  The returned structure is a
DUPLICATE, and is not the same as the structure brought in.
Additionally, its list size is one anchor element long.
Generates a new anchor structure for performing injections on anchors anchors given a replacement variable position and a replacement string . This function is a primary component of the injection facilities of BP . The returned structure is a DUPLICATE and is not the same as the structure brought in . Additionally its list size is one anchor element long .
P_BP_HTML_ANCHOR_LIST BP_GenerateAnchorString(P_BP_HTML_ANCHOR_LIST anchor, size_t varPos, char *newVal)
{
	if (!anchor || !newVal)
		return NULL;
	if(!BP_StringIsReasonablePrintableString(newVal, bpstrlen(newVal), BP_FALSE, BP_FALSE))
		return NULL;
	P_BP_HTML_ANCHOR_LIST newAnchor = (P_BP_HTML_ANCHOR_LIST) bpcalloc(sizeof(BP_HTML_ANCHOR_LIST), 1);
	if (!newAnchor)
		return NULL;
	memcpy(newAnchor, anchor, sizeof(BP_HTML_ANCHOR_LIST));
	newAnchor->first = newAnchor;
	newAnchor->next = NULL;
	newAnchor->prev = NULL;
	return newAnchor;
}
P_BP_HTML_ANCHOR_LIST BP_GenerateAnchorString ( P_BP_HTML_ANCHOR_LIST anchor , size_t varPos , char * newVal ) { if ( ! anchor || ! newVal ) return NULL ; if ( ! BP_StringIsReasonablePrintableString ( newVal , bpstrlen ( newVal ) , BP_FALSE , BP_FALSE ) ) return NULL ; P_BP_HTML_ANCHOR_LIST newAnchor = ( P_BP_HTML_ANCHOR_LIST ) bpcalloc ( sizeof ( BP_HTML_ANCHOR_LIST ) , 1 ) ; if ( ! newAnchor ) return NULL ; memcpy ( newAnchor , anchor , sizeof ( BP_HTML_ANCHOR_LIST ) ) ; newAnchor -> first = newAnchor ; newAnchor -> next = NULL ; newAnchor -> prev = NULL ; return newAnchor ; }
Generates a new anchor structure for performing injections
on anchors anchors given a replacement variable position, and
a replacement string.
Generates a new anchor structure for performing injections on anchors anchors given a replacement variable position and a replacement string .
// ensure we have an anchor // ensure string is reasonable/printable // Allocate space for a new anchor, and copy in the old anchor structure // Null OOM check // copy in structure and reset list pointers // set the first pointer // return the new anchor