diff --git a/scapy.py b/scapy.py
index 6c68442da57b24fcdfb72dc9e5ccf991839adbbb..efa47b8aae043374f0789c91dc850fe2129af6de 100755
--- a/scapy.py
+++ b/scapy.py
@@ -3846,7 +3846,7 @@ class StrFixedLenField(StrField):
             l = self.length_from(None)
         except:
             l = RandNum(0,200)
-        return RandBin(self.length)
+        return RandBin(l)
 
 class NetBIOSNameField(StrFixedLenField):
     def __init__(self, name, default, length=31, shift=0):