New issue
Advanced search Search tips

Issue 775412 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Possible unintended usage of "kServiceWorkerUpdateErrorPrefix" variable file service_worker_dispatcher_host.cc line 273

Reported by pet...@gmail.com, Oct 17 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:56.0) Gecko/20100101 Firefox/56.0

Steps to reproduce the problem:
While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "chromium/src/content/browser/service_worker/service_worker_dispatcher_host.cc" line 273 (method ServiceWorkerDispatcherHost::OnUnregisterServiceWorker).

case ProviderStatus::DEAD_HOST:
      Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError(
          thread_id, request_id, blink::mojom::ServiceWorkerErrorType::kAbort,
          base::ASCIIToUTF16(kServiceWorkerUpdateErrorPrefix) + //HERE
          base::ASCIIToUTF16(kShutdownErrorMessage)));
      return;

Shouldn't kServiceWorker>Unregister<ErrorPrefix should be used (instead of kServiceWorker>Update<ErrorPrefix). It looks this was the intention (as in line 284).

Thanks,
Petru Florin Mihancea

What is the expected behavior?

What went wrong?
The problem has been detected automatically via static analysis.

Did this work before? N/A 

Chrome version: Repository Master  Channel: n/a
OS Version: OS X 10.12
Flash Version: Shockwave Flash 27.0 r0
 
Components: Blink>ServiceWorker

Comment 2 by falken@chromium.org, Oct 17 2017

Owner: leon....@intel.com
Status: Assigned (was: Unconfirmed)
Yep, this is a copy/paste error. Nice catch.
Project Member

Comment 3 by bugdroid1@chromium.org, Oct 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7c8e22db4b1fd59fbe8ca6c0a62542ab1269c27e

commit 7c8e22db4b1fd59fbe8ca6c0a62542ab1269c27e
Author: Han Leon <leon.han@intel.com>
Date: Wed Oct 18 01:06:30 2017

[ServiceWorker] Fix a copy/paste miss

For Unregister related codes:
kServiceWorkerUpdateErrorPrefix --> kServiceWorkerUnregisterErrorPrefix

BUG= 775412 

Change-Id: Ib2a0dff68caef88cacd7ce6d449a7ef6adb4a8c6
Reviewed-on: https://chromium-review.googlesource.com/724439
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Han Leon <leon.han@intel.com>
Cr-Commit-Position: refs/heads/master@{#509639}
[modify] https://crrev.com/7c8e22db4b1fd59fbe8ca6c0a62542ab1269c27e/content/browser/service_worker/service_worker_dispatcher_host.cc

Comment 4 by falken@chromium.org, Oct 18 2017

Status: Fixed (was: Assigned)

Sign in to add a comment