File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
samples/net/zoap_server/src Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -217,8 +217,11 @@ static int test_post(struct zoap_resource *resource,
217
217
zoap_header_set_token (& response , token , tkl );
218
218
219
219
for (p = location_path ; * p ; p ++ ) {
220
- zoap_add_option (& response , ZOAP_OPTION_LOCATION_PATH ,
221
- * p , strlen (* p ));
220
+ r = zoap_add_option (& response , ZOAP_OPTION_LOCATION_PATH ,
221
+ * p , strlen (* p ));
222
+ if (r < 0 ) {
223
+ return - EINVAL ;
224
+ }
222
225
}
223
226
224
227
return net_context_sendto (pkt , from , sizeof (struct sockaddr_in6 ),
@@ -280,8 +283,11 @@ static int location_query_post(struct zoap_resource *resource,
280
283
zoap_header_set_token (& response , token , tkl );
281
284
282
285
for (p = location_query ; * p ; p ++ ) {
283
- zoap_add_option (& response , ZOAP_OPTION_LOCATION_QUERY ,
284
- * p , strlen (* p ));
286
+ r = zoap_add_option (& response , ZOAP_OPTION_LOCATION_QUERY ,
287
+ * p , strlen (* p ));
288
+ if (r < 0 ) {
289
+ return - EINVAL ;
290
+ }
285
291
}
286
292
287
293
return net_context_sendto (pkt , from , sizeof (struct sockaddr_in6 ),
You can’t perform that action at this time.
0 commit comments