#vulnerable code 
                                @Test
    public void testWriteValueCopiesFieldName()
        throws Exception
    {
        IonStruct data = struct("{a:{b:10}}");
        IonReader ir = system().newReader(data);
        ir.next();
        ir.stepIn();
        expectNextField(ir, "a");

        iw = makeWriter();
        iw.stepIn(IonType.STRUCT);
        iw.writeValue(ir);
        iw.stepOut();
        assertEquals(data, reloadSingleValue());

        IonValue a = data.get("a");
        ir = system().newReader(a);
        ir.next();

        iw = makeWriter();
        iw.stepIn(IonType.STRUCT);
        iw.writeValue(ir);
        iw.stepOut();
        assertEquals(data, reloadSingleValue());
    } 
                            #location 17 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void testWriteValueCopiesFieldName()
        throws Exception
    {
        IonStruct data = struct("{a:{b:10}}");
        IonReader ir = system().newReader(data);
        ir.next();
        ir.stepIn();
        expectNextField(ir, "a");

        iw = makeWriter();
        iw.stepIn(IonType.STRUCT);
        iw.writeValue(ir);
        iw.stepOut();
        assertEquals(data, reloadSingleValue());
    }