Skip to content

Commit

Permalink
Fix NPE when writing last (null) SpnegoToken (Fixes #775)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen van Erp <[email protected]>
  • Loading branch information
hierynomus committed Jul 13, 2023
1 parent a7108c3 commit 911d88a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/hierynomus/spnego/RawToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package com.hierynomus.spnego;

import java.io.IOException;

import com.hierynomus.asn1.types.constructed.ASN1TaggedObject;
import com.hierynomus.protocol.commons.buffer.Buffer;

Expand All @@ -35,6 +33,8 @@ protected void parseTagged(ASN1TaggedObject asn1TaggedObject) throws SpnegoExcep

@Override
public void write(Buffer<?> buffer) throws SpnegoException {
buffer.putRawBytes(rawToken);
if (rawToken != null) {
buffer.putRawBytes(rawToken);
}
}
}

0 comments on commit 911d88a

Please sign in to comment.