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,
217217 zoap_header_set_token (& response , token , tkl );
218218
219219 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+ }
222225 }
223226
224227 return net_context_sendto (pkt , from , sizeof (struct sockaddr_in6 ),
@@ -280,8 +283,11 @@ static int location_query_post(struct zoap_resource *resource,
280283 zoap_header_set_token (& response , token , tkl );
281284
282285 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+ }
285291 }
286292
287293 return net_context_sendto (pkt , from , sizeof (struct sockaddr_in6 ),
You can’t perform that action at this time.
0 commit comments