Closed Bug 1300065 Opened 8 years ago Closed 3 years ago

Icons: Why do we add 1 to the content length header when decoding icons?

Categories

(Firefox for Android Graveyard :: Favicon Handling, defect, P3)

All
Android
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: sebastian, Unassigned)

References

Details

This came up in bug 1290014.

LoadFaviconTask:
https://dxr.mozilla.org/mozilla-central/rev/3ba5426a03b495b6417fffb872d42874edb80855/mobile/android/base/java/org/mozilla/gecko/favicons/LoadFaviconTask.java#347

> if (response.contentLength > 0) {
>    // The size was reported and sane, so let's use that.
>    // Integer overflow should not be a problem for Favicon sizes...
>   bufferSize = response.contentLength + 1;
> }

Why do we add one to the content length to get the buffer size?

It looks like the code came in here (bug 748100):
https://hg.mozilla.org/mozilla-central/rev/1c402a47da51

Unfortunately there's no explanation why the "+1" was added. It looks wrong.
Priority: -- → P3
OS: Unspecified → Android
Hardware: Unspecified → All
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.