]> granicus.if.org Git - esp-idf/commitdiff
Fix potential NULL pointer dereference crash.
authorWayne Keenan <WayneKeenan@users.noreply.github.com>
Mon, 30 Apr 2018 07:03:35 +0000 (08:03 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Apr 2018 07:03:35 +0000 (08:03 +0100)
examples/protocols/mdns/main/mdns_example_main.c

index 44984c26820a9b991c06026bfa85c4e3f2a1cecf..fb805545aba85250cbdcf3f73dcaf994548e8145 100755 (executable)
@@ -137,7 +137,7 @@ static void mdns_print_results(mdns_result_t * results){
         if(r->txt_count){
             printf("  TXT : [%u] ", r->txt_count);
             for(t=0; t<r->txt_count; t++){
-                printf("%s=%s; ", r->txt[t].key, r->txt[t].value);
+                printf("%s=%s; ", r->txt[t].key, r->txt[t].value?r->txt[t].value:"NULL");
             }
             printf("\n");
         }