Closed Bug 1553759 Opened 5 years ago Closed 5 years ago

'LZ4_decompress_fast' is deprecated: This function is deprecated and unsafe. Consider using LZ4_decompress_safe() instead

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: freddy, Assigned: tcampbell)

Details

Attachments

(1 file)

Source: https://searchfox.org/mozilla-central/rev/952521e6164ddffa3f34bc8cfa5a81afc5b859c4/mfbt/Compression.cpp#41

Full warningtext :

warning: mfbt/Compression.cpp:41:13 [-Wdeprecated-declarations] 'LZ4_decompress_fast' is deprecated: This function is deprecated and unsafe. Consider using LZ4_decompress_safe() instead

My guess is that the supposed unsafety comes from the caller supplying the output size, but the real source of this warning is a bit unclear to me.

If that's the case, then I think our version is less problematic, given that it casts the output size into a CheckedInt?

code snippet:

bool LZ4::decompress(const char* aSource, char* aDest, size_t aOutputSize) {
  CheckedInt<int> outputSizeChecked = aOutputSize;
  MOZ_ASSERT(outputSizeChecked.isValid());
  int ret = LZ4_decompress_fast(aSource, aDest, outputSizeChecked.value());
  return ret >= 0;
}

The implementation of this method calls deprecated functions and
generates compiler warnings. It is never used, so just remove it.

This function doesn't seem to be used any more. I'd propose we just delete it. Pushing to try to see if things break, but patch is attached.

Assignee: nobody → tcampbell
Status: NEW → ASSIGNED
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d0c38d223c9 Remove unused LZ4::decompress method r=froydnj
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: