[Midnightbsd-cvs] src [11280] trunk/usr.sbin/bluetooth/sdpcontrol: sync with freebsd
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Jul 3 21:09:02 EDT 2018
Revision: 11280
http://svnweb.midnightbsd.org/src/?rev=11280
Author: laffer1
Date: 2018-07-03 21:09:01 -0400 (Tue, 03 Jul 2018)
Log Message:
-----------
sync with freebsd
Modified Paths:
--------------
trunk/usr.sbin/bluetooth/sdpcontrol/Makefile
trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.h
trunk/usr.sbin/bluetooth/sdpcontrol/search.c
Property Changed:
----------------
trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
Modified: trunk/usr.sbin/bluetooth/sdpcontrol/Makefile
===================================================================
--- trunk/usr.sbin/bluetooth/sdpcontrol/Makefile 2018-07-04 01:08:02 UTC (rev 11279)
+++ trunk/usr.sbin/bluetooth/sdpcontrol/Makefile 2018-07-04 01:09:01 UTC (rev 11280)
@@ -1,5 +1,6 @@
-# $Id: Makefile,v 1.2 2013-01-01 17:41:47 laffer1 Exp $
# $MidnightBSD$
+# $Id: Makefile,v 1.1 2003/09/08 02:27:27 max Exp $
+# $FreeBSD: stable/10/usr.sbin/bluetooth/sdpcontrol/Makefile 121054 2003-10-12 22:04:24Z emax $
PROG= sdpcontrol
MAN= sdpcontrol.8
Modified: trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
===================================================================
--- trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 2018-07-04 01:08:02 UTC (rev 11279)
+++ trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 2018-07-04 01:09:01 UTC (rev 11280)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\" Copyright (c) 2003 Maksim Yevmenkin <m_evmenkin at yahoo.com>
.\" All rights reserved.
.\"
@@ -22,15 +23,15 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: sdpcontrol.8,v 1.2 2013-01-01 17:41:47 laffer1 Exp $
-.\" $MidnightBSD$
+.\" $Id: sdpcontrol.8,v 1.1 2003/09/08 02:27:27 max Exp $
+.\" $FreeBSD: stable/10/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8 282958 2015-05-15 10:56:22Z trasz $
.\"
-.Dd September 7, 2003
+.Dd February 7, 2015
.Dt SDPCONTROL 8
.Os
.Sh NAME
.Nm sdpcontrol
-.Nd SDP query utility
+.Nd Bluetooth Service Discovery Protocol query utility
.Sh SYNOPSIS
.Nm
.Fl h
@@ -86,7 +87,7 @@
.Nm
are:
.Pp
-.Bl -tag -offset indent -compact
+.Bl -tag -width "Browse" -offset indent -compact
.It Cm Browse
.It Cm Search
.El
Property changes on: trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
===================================================================
--- trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c 2018-07-04 01:08:02 UTC (rev 11279)
+++ trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c 2018-07-04 01:09:01 UTC (rev 11280)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* sdpcontrol.c
*
@@ -25,8 +26,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sdpcontrol.c,v 1.2 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: sdpcontrol.c,v 1.1 2003/09/08 02:27:27 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c 133178 2004-08-05 16:32:41Z emax $
*/
#include <assert.h>
Modified: trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.h
===================================================================
--- trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.h 2018-07-04 01:08:02 UTC (rev 11279)
+++ trunk/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.h 2018-07-04 01:09:01 UTC (rev 11280)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* sdpcontrol.h
*
@@ -25,8 +26,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: sdpcontrol.h,v 1.2 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: sdpcontrol.h,v 1.1 2003/09/08 02:27:27 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.h 121054 2003-10-12 22:04:24Z emax $
*/
#ifndef __SDPCONTROL_H__
Modified: trunk/usr.sbin/bluetooth/sdpcontrol/search.c
===================================================================
--- trunk/usr.sbin/bluetooth/sdpcontrol/search.c 2018-07-04 01:08:02 UTC (rev 11279)
+++ trunk/usr.sbin/bluetooth/sdpcontrol/search.c 2018-07-04 01:09:01 UTC (rev 11280)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*
* search.c
*
@@ -25,8 +26,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: search.c,v 1.3 2013-01-01 17:41:47 laffer1 Exp $
- * $MidnightBSD$
+ * $Id: search.c,v 1.2 2003/09/08 17:35:15 max Exp $
+ * $FreeBSD: stable/10/usr.sbin/bluetooth/sdpcontrol/search.c 290395 2015-11-05 16:08:38Z emax $
*/
#include <netinet/in.h>
@@ -102,6 +103,12 @@
/* NOT REACHED */
}
+ if (len > (end - start)) {
+ fprintf(stderr, "Invalid Service Class ID List. " \
+ "Too long len=%d\n", len);
+ return;
+ }
+
while (start < end) {
SDP_GET8(type, start);
switch (type) {
@@ -258,28 +265,31 @@
case SDP_DATA_STR8:
case SDP_DATA_URL8:
SDP_GET8(len, start);
- fprintf(stdout, "%*.*s\n", len, len, (char *) start);
- start += len;
+ for (; start < end && len > 0; start ++, len --)
+ fprintf(stdout, "%c", *start);
+ fprintf(stdout, "\n");
break;
case SDP_DATA_STR16:
case SDP_DATA_URL16:
SDP_GET16(len, start);
- fprintf(stdout, "%*.*s\n", len, len, (char *) start);
- start += len;
+ for (; start < end && len > 0; start ++, len --)
+ fprintf(stdout, "%c", *start);
+ fprintf(stdout, "\n");
break;
case SDP_DATA_STR32:
case SDP_DATA_URL32:
SDP_GET32(len, start);
- fprintf(stdout, "%*.*s\n", len, len, (char *) start);
- start += len;
+ for (; start < end && len > 0; start ++, len --)
+ fprintf(stdout, "%c", *start);
+ fprintf(stdout, "\n");
break;
case SDP_DATA_SEQ8:
case SDP_DATA_ALT8:
SDP_GET8(len, start);
- for (; len > 0; start ++, len --)
+ for (; start < end && len > 0; start ++, len --)
fprintf(stdout, "%#2.2x ", *start);
fprintf(stdout, "\n");
break;
@@ -287,7 +297,7 @@
case SDP_DATA_SEQ16:
case SDP_DATA_ALT16:
SDP_GET16(len, start);
- for (; len > 0; start ++, len --)
+ for (; start < end && len > 0; start ++, len --)
fprintf(stdout, "%#2.2x ", *start);
fprintf(stdout, "\n");
break;
@@ -295,7 +305,7 @@
case SDP_DATA_SEQ32:
case SDP_DATA_ALT32:
SDP_GET32(len, start);
- for (; len > 0; start ++, len --)
+ for (; start < end && len > 0; start ++, len --)
fprintf(stdout, "%#2.2x ", *start);
fprintf(stdout, "\n");
break;
@@ -341,6 +351,12 @@
/* NOT REACHED */
}
+ if (len > (end - start)) {
+ fprintf(stderr, "Invalid Protocol Descriptor List. " \
+ "Too long, len=%d\n", len);
+ return;
+ }
+
while (start < end) {
SDP_GET8(type, start);
switch (type) {
@@ -363,6 +379,12 @@
/* NOT REACHED */
}
+ if (len > (end - start)) {
+ fprintf(stderr, "Invalid Protocol Descriptor List. " \
+ "Too long, len=%d\n", len);
+ return;
+ }
+
print_protocol_descriptor(start, start + len);
start += len;
}
@@ -415,6 +437,12 @@
/* NOT REACHED */
}
+ if (len > (end - start)) {
+ fprintf(stderr, "Invalid Bluetooth Profile Descriptor List. " \
+ "Too long, len=%d\n", len);
+ return;
+ }
+
while (start < end) {
SDP_GET8(type, start);
switch (type) {
@@ -438,6 +466,13 @@
/* NOT REACHED */
}
+ if (len > (end - start)) {
+ fprintf(stderr, "Invalid Bluetooth Profile " \
+ "Descriptor List. " \
+ "Too long, len=%d\n", len);
+ return;
+ }
+
/* Get UUID */
SDP_GET8(type, start);
switch (type) {
More information about the Midnightbsd-cvs
mailing list