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
,
Oct 17 2017
Yep, this is a copy/paste error. Nice catch.
,
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
,
Oct 18 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ligim...@chromium.org
, Oct 17 2017