mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Fix possible memory corruption
A user reports a SIGSEGV that points to DownloadFromDCWidget::updateProgressBar() in relation to strlen()/strdup(), at end of download. Reading the code, as I can't reproduce the crash, it seems that the progress_bar_text is set to NULL and later strdup-ped. The man page is not fully clear on this, but setting it to the empty strings is much safer. Might fix: #507 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
69f8fc3c5b
commit
7e39be436b
1 changed files with 1 additions and 1 deletions
|
@ -108,7 +108,7 @@ void DownloadFromDCWidget::updateProgressBar()
|
|||
// if we get the first actual text after the download is finished
|
||||
// (which happens for example on the OSTC), then don't bother
|
||||
if (!same_string(progress_bar_text, "") && IS_FP_SAME(progress_bar_fraction, 1.0))
|
||||
progress_bar_text = NULL;
|
||||
progress_bar_text = "";
|
||||
}
|
||||
if (!same_string(progress_bar_text , "")) {
|
||||
ui.progressBar->setFormat(progress_bar_text);
|
||||
|
|
Loading…
Reference in a new issue