Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
734 B

16 years ago
.TH range_bufinbuf 3
range_bufinbuf \- range check for buf in buffer
.B #include <libowfat/rangecheck.h>
16 years ago
int \fBrange_bufinbuf\fR(const void* buf1,size_t len1,
const void* buf2,size_t len2);
range_bufinbuf checks that the buffer \fIbuf2\fR[0..\fIlen2\fR-1] lies
entirely in \fIbuf1\fR[0..\fIlen1\fR].
If the buffer is 0-terminated and you don't know the length beforehand,
use range_strinbuf, range_str2inbuf or range_str4inbuf instead.
If one of the buffers is implausible (buf is NULL or buf+len has an integer
overflow), return 0.
If the buf2[0..len2-1] lies before or after buf1[0..len1-1], return 0.
Otherwise, return 1.