You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by ar...@apache.org on 2022/06/09 14:16:09 UTC

[systemds] branch branch-2.2.1 created (now d7d77dfc0b)

This is an automated email from the ASF dual-hosted git repository.

arnabp20 pushed a change to branch branch-2.2.1
in repository https://gitbox.apache.org/repos/asf/systemds.git


      at d7d77dfc0b [SYSTEMDS-3282] Upper bound for number of decoders

This branch includes the following new commits:

     new d7d77dfc0b [SYSTEMDS-3282] Upper bound for number of decoders

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[systemds] 01/01: [SYSTEMDS-3282] Upper bound for number of decoders

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

arnabp20 pushed a commit to branch branch-2.2.1
in repository https://gitbox.apache.org/repos/asf/systemds.git

commit d7d77dfc0b8ec7164bb3d9db30181aedd185fe14
Author: arnabp <ar...@tugraz.at>
AuthorDate: Wed Feb 2 21:25:08 2022 +0100

    [SYSTEMDS-3282] Upper bound for number of decoders
    
    This patch adds a coherence check on the number of deserialized
    decoders in DecoderComposite object.
    
    Closes #1527.
---
 .../org/apache/sysds/runtime/transform/decode/DecoderComposite.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/sysds/runtime/transform/decode/DecoderComposite.java b/src/main/java/org/apache/sysds/runtime/transform/decode/DecoderComposite.java
index 7081405735..ca2b370d29 100644
--- a/src/main/java/org/apache/sysds/runtime/transform/decode/DecoderComposite.java
+++ b/src/main/java/org/apache/sysds/runtime/transform/decode/DecoderComposite.java
@@ -83,6 +83,7 @@ public class DecoderComposite extends Decoder
 	public void writeExternal(ObjectOutput out) throws IOException {
 		super.writeExternal(out);
 		out.writeInt(_decoders.size());
+		out.writeInt(_schema == null ? 0:_schema.length); //write #columns
 		for(Decoder decoder : _decoders) {
 			out.writeByte(DecoderFactory.getDecoderType(decoder));
 			decoder.writeExternal(out);
@@ -93,6 +94,9 @@ public class DecoderComposite extends Decoder
 	public void readExternal(ObjectInput in) throws IOException {
 		super.readExternal(in);
 		int decodersSize = in.readInt();
+		int nCols = in.readInt();
+		if (nCols > 0 && decodersSize > nCols*2)
+			throw new IOException("Too many decoders");
 		_decoders = new ArrayList<>();
 		for(int i = 0; i < decodersSize; i++) {
 			Decoder decoder = DecoderFactory.createInstance(in.readByte());