Closed Bug 702685 Opened 14 years ago Closed 14 years ago

PHP record-size validation not ported over to python server

Categories

(Cloud Services Graveyard :: Server: Sync, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: telliott, Assigned: tarek)

Details

(Keywords: regression, Whiteboard: [qa+])

Attachments

(1 file, 1 obsolete file)

This snippet of code was in the php server: if ($this->payload_exists()) { if (!is_string($this->wbo_hash['payload'])) { $this->_error[] = "payload needs to be json-encoded"; } else if (WEAVE_PAYLOAD_MAX_SIZE && mb_strlen($this->wbo_hash['payload'], '8bit') > WEAVE_PAYLOAD_MAX_SIZE) { $this->_error[] = "payload too large"; } } I cannot find the equivalent in the python server. Am I just missing it? It's a pretty important piece of protection.
sorry, should have been clearer - that's in the WBO validation method
no I did miss it
Whiteboard: [qa+]
Attached patch patch limiting wbo payload size (obsolete) — Splinter Review
Patch attached. I've hard-coded the limit as a module-level constant since there's no obvious way to make it configurable.
Attachment #584692 - Flags: review?(tarek)
Oops, telliott points out that the payload is unicode and we should limit based on the encoded size in bytes. Patch updated accordingly.
Attachment #584692 - Attachment is obsolete: true
Attachment #584692 - Flags: review?(tarek)
Attachment #584862 - Flags: review?(telliott)
Comment on attachment 584862 [details] [diff] [review] patch limiting wbo payload size Looks good.
Attachment #584862 - Flags: review?(telliott) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
QA to verify this ASAP.
Basing my comments on :rfkelly Comment 6 syncstorage/tests/test_wbo.py is now syncstorage/tests/test_bso.py syncstorage/wbo.py is now syncstorage/bso.py
Code verified and passed functional tests of Sync 1.1 and 2.0 for a 4/23/2012 deploy to qa1.
Status: RESOLVED → VERIFIED
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: