mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-29 13:45:28 +03:00
RISCOS: fix obvious NULL dereferences in URL complete.
This commit is contained in:
parent
abc7a71117
commit
a470aacdb2
@ -178,7 +178,11 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme)
|
||||
|
||||
url_bar->text_size = RO_GUI_MAX_URL_SIZE;
|
||||
url_bar->text_buffer = malloc(url_bar->text_size);
|
||||
strncpy(url_bar->text_buffer, "", url_bar->text_size);
|
||||
if (url_bar->text_buffer == NULL) {
|
||||
free(url_bar);
|
||||
return NULL;
|
||||
}
|
||||
url_bar->text_buffer[0] = 0;
|
||||
|
||||
url_bar->hidden = false;
|
||||
|
||||
|
@ -85,10 +85,11 @@ void ro_gui_url_complete_start(struct toolbar *toolbar)
|
||||
|
||||
ro_gui_url_complete_close();
|
||||
url = ro_toolbar_get_url(toolbar);
|
||||
|
||||
url_complete_matched_string = strdup(url);
|
||||
if (url_complete_matched_string)
|
||||
url_complete_parent = parent;
|
||||
if (url != NULL) {
|
||||
url_complete_matched_string = strdup(url);
|
||||
if (url_complete_matched_string)
|
||||
url_complete_parent = parent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user