Opened 8 years ago

Closed 8 years ago

#13445 closed bug (fixed)

[SoftwareUpdater] crash

Reported by: diver Owned by: perelandra
Priority: normal Milestone: Unscheduled
Component: Applications/SoftwareUpdater Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

hrev51114.

SoftwareUpdater crashed when started with no network connection.

Attachments (1)

SoftwareUpdater-28670-debug-24-04-2017-13-43-32.report (15.2 KB ) - added by diver 8 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by diver, 8 years ago

patch: 01

comment:2 by perelandra, 8 years ago

Resolution: fixed
Status: newclosed

Thanks for the report. This will be fixed in version 1.0.1. Strangely this only happened on x64.

diff --git a/src/apps/softwareupdater/UpdateManager.cpp b/src/apps/softwareupdater/UpdateManager.cpp
index 12fa3b0..5041380 100644
--- a/src/apps/softwareupdater/UpdateManager.cpp
+++ b/src/apps/softwareupdater/UpdateManager.cpp
@@ -243,8 +243,8 @@ UpdateManager::Warn(status_t error, const char* format, ...)
        char buffer[256];
        va_list args;
        va_start(args, format);
-       vfprintf(stderr, format, args);
        vsnprintf(buffer, sizeof(buffer), format, args);
+       fprintf(stderr, buffer);
        va_end(args);
 
        if (error == B_OK)

comment:3 by korli, 8 years ago

@perelandra we usually leave the bug report open until the fix actually lands in git master with a hrev to be tested by the reporter.

in reply to:  3 comment:4 by perelandra, 8 years ago

Resolution: fixed
Status: closedreopened

Replying to korli:

@perelandra we usually leave the bug report open until the fix actually lands in git master with a hrev to be tested by the reporter.

OK

comment:5 by axeld, 8 years ago

Also, it's not a good idea to use fprintf() when you don't actually have any formatting to do. Use fputs() instead.

comment:6 by perelandra, 8 years ago

In all the code I've browsed through I don't recall seeing fputs or puts used so that doesn't seem to be strictly enforced. I had to look those up to know what they do. How about using: fprintf(stderr, "%s", string) ?

comment:7 by pulkomandy, 8 years ago

patch: 10

comment:8 by perelandra, 8 years ago

Fixed code in hrev51148, also removed the ability to "Continue anyway" when no network is detected since there relly is no point in doing so.

comment:9 by perelandra, 8 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.