OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de43400
)
lib: Fix missing error handling when SDP record is NULL
author
Marcel Holtmann
<marcel@holtmann.org>
Tue, 10 Nov 2015 14:54:12 +0000
(15:54 +0100)
committer
Marcel Holtmann
<marcel@holtmann.org>
Tue, 10 Nov 2015 14:54:12 +0000
(15:54 +0100)
lib/sdp.c
patch
|
blob
|
history
diff --git
a/lib/sdp.c
b/lib/sdp.c
index
155eca5
..
eb408a9
100644
(file)
--- a/
lib/sdp.c
+++ b/
lib/sdp.c
@@
-932,8
+932,12
@@
int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *buf)
void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *d)
{
- sdp_data_t *p = sdp_data_get(rec, attr);
+ sdp_data_t *p;
+
+ if (!rec)
+ return;
+ p = sdp_data_get(rec, attr);
if (p) {
rec->attrlist = sdp_list_remove(rec->attrlist, p);
sdp_data_free(p);
@@
-1667,7
+1671,7
@@
void sdp_data_print(sdp_data_t *d)
sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attrId)
{
- if (rec->attrlist) {
+ if (rec
&& rec
->attrlist) {
sdp_data_t sdpTemplate;
sdp_list_t *p;