File: range_ptrinbuf.3

package info (click to toggle)
libowfat 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,288 kB
  • sloc: ansic: 20,181; makefile: 16
file content (20 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.TH range_ptrinbuf 3
.SH NAME
range_ptrinbuf \- range check pointer in buffer
.SH SYNTAX
.B #include <libowfat/rangecheck.h>

int \fBrange_ptrinbuf\fR(const void* buf,size_t len,const void* ptr);

.SH DESCRIPTION
range_ptrinbuf checks if \fIptr\fR points to \fIbuf\fR[0..\fIlen\fR-1].
.SH "RETURN VALUE"
If the buffer is implausible (buf is NULL or buf+len has an integer
overflow), return 0.

If \fIptr\fR points to one of \fIbuf\fR[0], \fIbuf\fR[1], ... or
\fIbuf\fR[\fIlen\fR-1], return 1.

Otherwise, return 0.
.SH "SEE ALSO"
rangecheck(3)