Page MenuHomePhabricator

Fix issue where message contained % but wasn't intended for use with parameters
ClosedPublic

Authored by hach-que on May 14 2014, 7:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 25, 3:37 PM
Unknown Object (File)
Wed, Dec 25, 3:37 PM
Unknown Object (File)
Wed, Dec 25, 3:37 PM
Unknown Object (File)
Wed, Dec 25, 2:04 PM
Unknown Object (File)
Wed, Dec 25, 1:56 PM
Unknown Object (File)
Mon, Dec 23, 9:48 AM
Unknown Object (File)
Mon, Dec 23, 9:48 AM
Unknown Object (File)
Mon, Dec 23, 9:48 AM
Subscribers

Details

Summary

This fixes an issue with the C# linter where a message could be returned from cslint that wasn't intended for use with parameters. This just ensures there's enough parameters so that it won't crash (and consequently ignore lint messages).

Test Plan

Ran the linter, it didn't crash.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

hach-que retitled this revision from to Fix issue where message contained % but wasn't intended for use with parameters.
hach-que updated this object.
hach-que edited the test plan for this revision. (Show Details)
hach-que added a reviewer: epriestley.

Is the "crash" a vsprintf() error raising into an exception? Can we do something like this instead?

$message = @vsprintf($pattern, ...);
if ($message === false) {
  $message = $pattern;
}

That will get a bunch of (probably hypothetical) cases right that this misses, I think.

hach-que edited edge metadata.

Feedback from code review

epriestley edited edge metadata.
This revision is now accepted and ready to land.May 15 2014, 12:11 AM
epriestley updated this revision to Diff 21682.
epriestley added a subscriber: Unknown Object (User).

Closed by commit rARCfcdacc28b8a2 (authored by @jamesr, committed by @epriestley).