Bug 567401 - should set default value before calling the function POST_OPTION_HOOK
Summary: should set default value before calling the function POST_OPTION_HOOK
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.7   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-28 01:11 EDT by Mingfeng Liu CLA
Modified: 2021-06-25 16:24 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mingfeng Liu CLA 2020-09-28 01:11:40 EDT
There is no default value when calling the function POST_OPTION_HOOK if there is no "-s " option.

The modification is from the commit f848512d7d22c5ba1f449f8df764eb0e249bb898.
it has default value DEFAULT_SERVER_URL before this commit .


I suggest to add the code 
        if (url_cnt == 0) {
            if (url_cnt >= url_max) url_arr = (const char **)loc_realloc((void *)url_arr, sizeof(const char *) * (url_max += 16));
            url_arr[url_cnt++] = DEFAULT_SERVER_URL;
        }

before calling the function POST_OPTION_HOOK.
Comment 1 Mingfeng Liu CLA 2020-09-28 01:22:46 EDT
We defined the POST_OPTION_HOOK which will use the default value.
Comment 2 Eugene Tarassov CLA 2020-10-06 10:25:17 EDT
Fixed.
Thanks!